Message262231
Per the docs ( https://docs.python.org/3/library/threading.html#rlock-objects ):
"To unlock the lock, a thread calls its release() method. acquire()/release() call pairs may be nested; only the final release() (the release() of the outermost pair) resets the lock to unlocked and allows another thread blocked in acquire() to proceed."
The docs aren't super clear on the return type, but they aren't so overly specified as to make returning either True or 1 incorrect; they use lowercase "true" to describe the return value, which doesn't *have* to mean True, just something that evaluates as truthy.
In 3.5 at least, it looks like both initial and subsequent acquires are all returning True, even when called without passing an argument; this actually violates the docs, which claim that not passing an argument means "There is no return value" (possibly only when there is contended acquisition, the wording is odd), when in fact a no-argument call returns True just like explicitly passing blocking as True. |
|
Date |
User |
Action |
Args |
2016-03-23 02:49:36 | josh.r | set | recipients:
+ josh.r, docs@python, smbrd |
2016-03-23 02:49:36 | josh.r | set | messageid: <1458701376.11.0.696104187632.issue26608@psf.upfronthosting.co.za> |
2016-03-23 02:49:36 | josh.r | link | issue26608 messages |
2016-03-23 02:49:35 | josh.r | create | |
|