Skip to content

Commit dd95974

Browse files
committed
#14823: Simplify threading.Lock.acquire argument discussion.
2 parents f398a94 + f7a6615 commit dd95974

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
@@ -426,15 +426,12 @@ All methods are executed atomically.
426426

427427
Acquire a lock, blocking or non-blocking.
428428

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

432-
When invoked with the *blocking* argument set to true, do the same thing as when
433-
called without arguments, and return true.
434-
435-
When invoked with the *blocking* argument set to false, do not block. If a call
436-
without an argument would block, return false immediately; otherwise, do the
437-
same thing as when called without arguments, and return true.
432+
When invoked with the *blocking* argument set to ``False``, do not block.
433+
If a call with *blocking* set to ``True`` would block, return ``False``
434+
immediately; otherwise, set the lock to locked and return ``True``.
438435

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

0 commit comments

Comments
 (0)