Message253703
When using threading.Lock, threading.Condition._is_owned is assuming that the calling thread is owning the condition lock if the lock cannot be acquired. This check is completely wrong if another thread owns the lock.
>>> cond = threading.Condition(threading.Lock())
>>> threading.Thread(target=cond.acquire).start()
>>> cond._is_owned()
True
>>> cond.notify()
>>> cond.wait(0)
False
Careful users that acquire the condition before calling wait() or notify() are not effected. Careless users that should have been warned by RuntimeError are.
Tested on Python 2.7 and 3.4.2 and 3.6.0a0. |
|
Date |
User |
Action |
Args |
2015-10-30 00:36:32 | nirs | set | recipients:
+ nirs |
2015-10-30 00:36:32 | nirs | set | messageid: <1446165392.31.0.717642417411.issue25516@psf.upfronthosting.co.za> |
2015-10-30 00:36:32 | nirs | link | issue25516 messages |
2015-10-30 00:36:31 | nirs | create | |
|