mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-115942: Add locked
to several multiprocessing locks (#115944)
Co-authored-by: mpage <mpage@cs.stanford.edu> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
6cd1d6c6b1
commit
f7305a06c7
10 changed files with 89 additions and 6 deletions
|
@ -1421,6 +1421,13 @@ object -- see :ref:`multiprocessing-managers`.
|
|||
when invoked on an unlocked lock, a :exc:`ValueError` is raised.
|
||||
|
||||
|
||||
.. method:: locked()
|
||||
|
||||
Return a boolean indicating whether this object is locked right now.
|
||||
|
||||
.. versionadded:: next
|
||||
|
||||
|
||||
.. class:: RLock()
|
||||
|
||||
A recursive lock object: a close analog of :class:`threading.RLock`. A
|
||||
|
@ -1481,6 +1488,13 @@ object -- see :ref:`multiprocessing-managers`.
|
|||
differs from the implemented behavior in :meth:`threading.RLock.release`.
|
||||
|
||||
|
||||
.. method:: locked()
|
||||
|
||||
Return a boolean indicating whether this object is locked right now.
|
||||
|
||||
.. versionadded:: next
|
||||
|
||||
|
||||
.. class:: Semaphore([value])
|
||||
|
||||
A semaphore object: a close analog of :class:`threading.Semaphore`.
|
||||
|
|
|
@ -709,6 +709,13 @@ call release as many times the lock has been acquired can lead to deadlock.
|
|||
There is no return value.
|
||||
|
||||
|
||||
.. method:: locked()
|
||||
|
||||
Return a boolean indicating whether this object is locked right now.
|
||||
|
||||
.. versionadded:: next
|
||||
|
||||
|
||||
.. _condition-objects:
|
||||
|
||||
Condition Objects
|
||||
|
@ -801,6 +808,12 @@ item to the buffer only needs to wake up one consumer thread.
|
|||
Release the underlying lock. This method calls the corresponding method on
|
||||
the underlying lock; there is no return value.
|
||||
|
||||
.. method:: locked()
|
||||
|
||||
Return a boolean indicating whether this object is locked right now.
|
||||
|
||||
.. versionadded:: next
|
||||
|
||||
.. method:: wait(timeout=None)
|
||||
|
||||
Wait until notified or until a timeout occurs. If the calling thread has
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue