Revision 51e3bb92
ID | 51e3bb9294fc333e07af4f26257738e4caa6e99e |
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: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Files
- added
- modified
- copied
- renamed
- deleted