Skip to content

Commit 720e655

Browse files
committed
Issue python#18916: Update thread module docstrings
* Fix acquire() signature * Remove outdated help(LockType) reference * Replace PyThread_allocate_lock() with threading.Lock() Patch by Christopher Welborn.
1 parent df07173 commit 720e655

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/_threadmodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ lock_PyThread_acquire_lock(lockobject *self, PyObject *args, PyObject *kwds)
159159
}
160160

161161
PyDoc_STRVAR(acquire_doc,
162-
"acquire([wait]) -> bool\n\
162+
"acquire(blocking=True, timeout=-1) -> bool\n\
163163
(acquire_lock() is an obsolete synonym)\n\
164164
\n\
165165
Lock the lock. Without argument, this blocks if the lock is already\n\
@@ -1134,7 +1134,8 @@ PyDoc_STRVAR(allocate_doc,
11341134
"allocate_lock() -> lock object\n\
11351135
(allocate() is an obsolete synonym)\n\
11361136
\n\
1137-
Create a new lock object. See help(LockType) for information about locks.");
1137+
Create a new lock object. See help(type(threading.Lock())) for\n\
1138+
information about locks.");
11381139

11391140
static PyObject *
11401141
thread_get_ident(PyObject *self)
@@ -1326,7 +1327,7 @@ The 'threading' module provides a more convenient interface.");
13261327

13271328
PyDoc_STRVAR(lock_doc,
13281329
"A lock object is a synchronization primitive. To create a lock,\n\
1329-
call the PyThread_allocate_lock() function. Methods are:\n\
1330+
call threading.Lock(). Methods are:\n\
13301331
\n\
13311332
acquire() -- lock the lock, possibly blocking until it can be obtained\n\
13321333
release() -- unlock of the lock\n\

0 commit comments

Comments
 (0)