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 Antony.Lee
Recipients Antony.Lee, mark.dickinson, neologix, tim.peters
Date 2014-02-08.01:42:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391823765.51.0.187287253804.issue20247@psf.upfronthosting.co.za>
In-reply-to
Content
For the second half, the same behavior applies under Linux -- basically, a simple Lock doesn't have a notion of owning thread and can the be unlocked by any thread.

However, the first half is not correct if the lock used is a *RLock-like* object (that is, it has a notion of ownership, and once acquired it can be reacquired and released only by the owning thread).  If that is the case, then _lock.acquire(0) will succeed if the current thread already owns the lock (or if no one owns it) and fail if the lock is owned by another thread.

So perhaps it may not be possible to do really better, but the docs could (should?) mention that custom implementations of locks passed to Condition objects should implement their own version of _is_owned.
History
Date User Action Args
2014-02-08 01:42:45Antony.Leesetrecipients: + Antony.Lee, tim.peters, mark.dickinson, neologix
2014-02-08 01:42:45Antony.Leesetmessageid: <1391823765.51.0.187287253804.issue20247@psf.upfronthosting.co.za>
2014-02-08 01:42:45Antony.Leelinkissue20247 messages
2014-02-08 01:42:44Antony.Leecreate