Skip to content
Snippets Groups Projects
Commit 51e3bb92 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix long-standing race condition bug in locking unittest


Every once in a while we saw failures in the locking unittest, but
weren't able to determine the cause. This patch fixes it by using
threading.Event instead of plain threading.Condition to notify another
thread. In most cases, threading.Condition must be used with another
variable to keep the actual state.  threading.Event does this for us.
Otherwise it can happen that the waiter only gets the lock after
condition was notified.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent db169865
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment