This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nirs
Recipients nirs
Date 2015-10-30.00:36:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446165392.31.0.717642417411.issue25516@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-10-30 00:36:32nirssetrecipients: + nirs
2015-10-30 00:36:32nirssetmessageid: <1446165392.31.0.717642417411.issue25516@psf.upfronthosting.co.za>
2015-10-30 00:36:32nirslinkissue25516 messages
2015-10-30 00:36:31nirscreate