Skip to content

Commit 0e7f08a

Browse files
YvesDupmiss-islington
authored andcommitted
pythongh-132795: Add docs for multiprocessing.Semaphore.locked (pythonGH-133299)
(cherry picked from commit de70614) Co-authored-by: Duprat <yduprat@gmail.com>
1 parent 3d44806 commit 0e7f08a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Doc/library/multiprocessing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,12 @@ object -- see :ref:`multiprocessing-managers`.
14191419
A solitary difference from its close analog exists: its ``acquire`` method's
14201420
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
14211421

1422+
.. method:: locked()
1423+
1424+
Return a boolean indicating whether this object is locked right now.
1425+
1426+
.. versionadded:: 3.14
1427+
14221428
.. note::
14231429
On macOS, this is indistinguishable from :class:`Semaphore` because
14241430
``sem_getvalue()`` is not implemented on that platform.
@@ -1571,6 +1577,12 @@ object -- see :ref:`multiprocessing-managers`.
15711577
A solitary difference from its close analog exists: its ``acquire`` method's
15721578
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
15731579

1580+
.. method:: locked()
1581+
1582+
Return a boolean indicating whether this object is locked right now.
1583+
1584+
.. versionadded:: 3.14
1585+
15741586
.. note::
15751587

15761588
On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with

0 commit comments

Comments
 (0)