« Previous | Next » 

Revision 03c5291c

Parent 488a5b2e
Child db2203e0

Added by Michael Hanselmann over 11 years ago

locking: Don't schedule pending acq. for short timeout

Scheduling a pending acquisition is relatively expensive and lot of code
is involved. Unless there is already one, a new pipe needs to be opened.
Data structures need to be updated as well, only to be undone shortly
after. This patch adds a small condition to return straight away if the
timeout is shorter than 1ms and the lock couldn't be acquired right
away. Blocking acquisitions are not affected, as are acquisitions with
longer timeouts.

While I tried hard, I could not find a way of writing a test
specifically for this case which wouldn't have involved making
significant other modifications. Other tests already exercise the new
code, though.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences