mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #11618: Fix the timeout logic in threading.Lock.acquire() under
Windows.
This commit is contained in:
parent
8c5b748026
commit
7899acfc23
3 changed files with 20 additions and 59 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue