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

Skip to content

Commit f9b49b6

Browse files
[3.10] gh-96448: fix documentation for _thread.lock.acquire (GH-96449) (#97852)
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 989bdbc commit f9b49b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/_thread.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,21 @@ This module defines the following constants and functions:
155155
Lock objects have the following methods:
156156

157157

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

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

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

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

174174
The return value is ``True`` if the lock is acquired successfully,
175175
``False`` if not.

0 commit comments

Comments
 (0)