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>
Loading
Please register or sign in to comment