Skip to content

Commit f7a6615

Browse files
committed
#14823: Simplify threading.Lock.acquire argument discussion.
1 parent 9729fd4 commit f7a6615

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

Doc/library/threading.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,12 @@ All methods are executed atomically.
403403

404404
Acquire a lock, blocking or non-blocking.
405405

406-
When invoked without arguments, block until the lock is unlocked, then set it to
407-
locked, and return true.
406+
When invoked with the *blocking* argument set to ``True`` (the default),
407+
block until the lock is unlocked, then set it to locked and return ``True``.
408408

409-
When invoked with the *blocking* argument set to true, do the same thing as when
410-
called without arguments, and return true.
411-
412-
When invoked with the *blocking* argument set to false, do not block. If a call
413-
without an argument would block, return false immediately; otherwise, do the
414-
same thing as when called without arguments, and return true.
409+
When invoked with the *blocking* argument set to ``False``, do not block.
410+
If a call with *blocking* set to ``True`` would block, return ``False``
411+
immediately; otherwise, set the lock to locked and return ``True``.
415412

416413
When invoked with the floating-point *timeout* argument set to a positive
417414
value, block for at most the number of seconds specified by *timeout*

0 commit comments

Comments
 (0)