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 <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
Loading
Please register or sign in to comment