cpython: 57a475e0e378 (original) (raw)
Mercurial > cpython
changeset 101208:57a475e0e378
Issue #18916: Update thread module docstrings * Fix acquire() signature * Remove outdated help(LockType) reference * Replace PyThread_allocate_lock() with threading.Lock() Patch by Christopher Welborn. [#18916]
Berker Peksag berker.peksag@gmail.com | |
---|---|
date | Mon, 02 May 2016 12:26:00 +0300 |
parents | 98678738b7e9(current diff)203c9c4ccb2a(diff) |
children | c5729c10ce65 |
files | |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-)[+] [-] Modules/_threadmodule.c 7 |
line wrap: on
line diff
--- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -159,7 +159,7 @@ lock_PyThread_acquire_lock(lockobject *s } PyDoc_STRVAR(acquire_doc, -"acquire([wait]) -> bool\n[](#l1.7) +"acquire(blocking=True, timeout=-1) -> bool\n[](#l1.8) (acquire_lock() is an obsolete synonym)\n[](#l1.9) \n[](#l1.10) Lock the lock. Without argument, this blocks if the lock is already\n[](#l1.11) @@ -1134,7 +1134,8 @@ PyDoc_STRVAR(allocate_doc, "allocate_lock() -> lock object\n[](#l1.13) (allocate() is an obsolete synonym)\n[](#l1.14) \n[](#l1.15) -Create a new lock object. See help(LockType) for information about locks."); +Create a new lock object. See help(type(threading.Lock())) for\n[](#l1.17) +information about locks."); static PyObject * thread_get_ident(PyObject *self) @@ -1326,7 +1327,7 @@ The 'threading' module provides a more c PyDoc_STRVAR(lock_doc, "A lock object is a synchronization primitive. To create a lock,\n[](#l1.25) -call the PyThread_allocate_lock() function. Methods are:\n[](#l1.26) +call threading.Lock(). Methods are:\n[](#l1.27) \n[](#l1.28) acquire() -- lock the lock, possibly blocking until it can be obtained\n[](#l1.29) release() -- unlock of the lock\n[](#l1.30)