diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-05-17 09:14:28 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-05-17 09:14:28 -0400 |
commit | 1c29e3a32cc8f17b563f41419df7d7f9ec286894 (patch) | |
tree | e51eb6e14b3363b6a15e7fe964ae6faf26aab6e3 /Doc/library | |
parent | 2a608170ebdc57d4e4ad13999954fef6d594dc30 (diff) | |
parent | 4b13fb98ae82788f988bb88e72466c8267a97171 (diff) | |
download | cpython-1c29e3a32cc8f17b563f41419df7d7f9ec286894.tar.gz |
#14823: Simplify threading.Lock.acquire argument discussion.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/threading.rst | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 42dbc01c00..613f304dea 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -426,15 +426,12 @@ All methods are executed atomically. Acquire a lock, blocking or non-blocking. - When invoked without arguments, block until the lock is unlocked, then set it to - locked, and return true. + When invoked with the *blocking* argument set to ``True`` (the default), + block until the lock is unlocked, then set it to locked and return ``True``. - When invoked with the *blocking* argument set to true, do the same thing as when - called without arguments, and return true. - - When invoked with the *blocking* argument set to false, do not block. If a call - without an argument would block, return false immediately; otherwise, do the - same thing as when called without arguments, and return true. + When invoked with the *blocking* argument set to ``False``, do not block. + If a call with *blocking* set to ``True`` would block, return ``False`` + immediately; otherwise, set the lock to locked and return ``True``. When invoked with the floating-point *timeout* argument set to a positive value, block for at most the number of seconds specified by *timeout* |