]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132795: Add docs for `multiprocessing.Semaphore.locked` (#133299)
authorDuprat <yduprat@gmail.com>
Mon, 19 May 2025 14:36:09 +0000 (16:36 +0200)
committerGitHub <noreply@github.com>
Mon, 19 May 2025 14:36:09 +0000 (20:06 +0530)
Doc/library/multiprocessing.rst

index 6c43d5fe166e2fa6bac5b05d58af6f603fe18dfc..80e33c4a1df015f86efbbca7a4b78cb01873a0b0 100644 (file)
@@ -1369,6 +1369,12 @@ object -- see :ref:`multiprocessing-managers`.
    A solitary difference from its close analog exists: its ``acquire`` method's
    first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
 
+   .. method:: locked()
+
+      Return a boolean indicating whether this object is locked right now.
+
+      .. versionadded:: 3.14
+
    .. note::
       On macOS, this is indistinguishable from :class:`Semaphore` because
       ``sem_getvalue()`` is not implemented on that platform.
@@ -1521,6 +1527,12 @@ object -- see :ref:`multiprocessing-managers`.
    A solitary difference from its close analog exists: its ``acquire`` method's
    first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
 
+   .. method:: locked()
+
+      Return a boolean indicating whether this object is locked right now.
+
+      .. versionadded:: 3.14
+
 .. note::
 
    On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with