Issue #11618: Fix the timeout logic in threading.Lock.acquire() under

Windows.
This commit is contained in:
Antoine Pitrou 2011-03-31 01:00:32 +02:00
parent 8c5b748026
commit 7899acfc23
3 changed files with 20 additions and 59 deletions

View file

@ -213,6 +213,16 @@ class LockTests(BaseLockTests):
lock.acquire()
lock.release()
def test_state_after_timeout(self):
# Issue #11618: check that lock is in a proper state after a
# (non-zero) timeout.
lock = self.locktype()
lock.acquire()
self.assertFalse(lock.acquire(timeout=0.01))
lock.release()
self.assertFalse(lock.locked())
self.assertTrue(lock.acquire(blocking=False))
class RLockTests(BaseLockTests):
"""