Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d456982

Browse files
[3.11] gh-96448: fix documentation for _thread.lock.acquire (GH-96449) (#97851)
gh-96448: fix documentation for _thread.lock.acquire (GH-96449) * fix documentation for _thread.lock.acquire * update formatting of _thread.lock.acquire() doc (cherry picked from commit 7acb93f) Co-authored-by: Daniel Giger <[email protected]> Co-authored-by: Daniel Giger <[email protected]>
1 parent cad4dca commit d456982

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/_thread.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,21 @@ This module defines the following constants and functions:
157157
Lock objects have the following methods:
158158

159159

160-
.. method:: lock.acquire(waitflag=1, timeout=-1)
160+
.. method:: lock.acquire(blocking=True, timeout=-1)
161161

162162
Without any optional argument, this method acquires the lock unconditionally, if
163163
necessary waiting until it is released by another thread (only one thread at a
164164
time can acquire a lock --- that's their reason for existence).
165165

166-
If the integer *waitflag* argument is present, the action depends on its
167-
value: if it is zero, the lock is only acquired if it can be acquired
168-
immediately without waiting, while if it is nonzero, the lock is acquired
166+
If the *blocking* argument is present, the action depends on its
167+
value: if it is False, the lock is only acquired if it can be acquired
168+
immediately without waiting, while if it is True, the lock is acquired
169169
unconditionally as above.
170170

171171
If the floating-point *timeout* argument is present and positive, it
172172
specifies the maximum wait time in seconds before returning. A negative
173173
*timeout* argument specifies an unbounded wait. You cannot specify
174-
a *timeout* if *waitflag* is zero.
174+
a *timeout* if *blocking* is False.
175175

176176
The return value is ``True`` if the lock is acquired successfully,
177177
``False`` if not.

0 commit comments

Comments
 (0)