[Python-checkins] [3.10] gh-96448: fix documentation for _thread.lock.acquire (GH-96449) (#97852)

orsenthil webhook-mailer at python.org
Tue Oct 4 18:21:43 EDT 2022


https://github.com/python/cpython/commit/f9b49b6bfa710c653b72f10b5b92ac791f51c229
commit: f9b49b6bfa710c653b72f10b5b92ac791f51c229
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: orsenthil <senthilx at amazon.com>
date: 2022-10-04T15:21:38-07:00
summary:

[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 7acb93f0d44c6fb971fdb09b86f68896e3b1e2f8)

Co-authored-by: Daniel Giger <danielg3432 at gmail.com>

Co-authored-by: Daniel Giger <danielg3432 at gmail.com>

files:
M Doc/library/_thread.rst

diff --git a/Doc/library/_thread.rst b/Doc/library/_thread.rst
index 1e6452b7b826..927245647090 100644
--- a/Doc/library/_thread.rst
+++ b/Doc/library/_thread.rst
@@ -155,21 +155,21 @@ This module defines the following constants and functions:
 Lock objects have the following methods:
 
 
-.. method:: lock.acquire(waitflag=1, timeout=-1)
+.. method:: lock.acquire(blocking=True, timeout=-1)
 
    Without any optional argument, this method acquires the lock unconditionally, if
    necessary waiting until it is released by another thread (only one thread at a
    time can acquire a lock --- that's their reason for existence).
 
-   If the integer *waitflag* argument is present, the action depends on its
-   value: if it is zero, the lock is only acquired if it can be acquired
-   immediately without waiting, while if it is nonzero, the lock is acquired
+   If the *blocking* argument is present, the action depends on its
+   value: if it is False, the lock is only acquired if it can be acquired
+   immediately without waiting, while if it is True, the lock is acquired
    unconditionally as above.
 
    If the floating-point *timeout* argument is present and positive, it
    specifies the maximum wait time in seconds before returning.  A negative
    *timeout* argument specifies an unbounded wait.  You cannot specify
-   a *timeout* if *waitflag* is zero.
+   a *timeout* if *blocking* is False.
 
    The return value is ``True`` if the lock is acquired successfully,
    ``False`` if not.



More information about the Python-checkins mailing list