https://github.com/python/cpython/commit/de70614c1387636c8f835ee3e4eb36c8ae721f21
commit: de70614c1387636c8f835ee3e4eb36c8ae721f21
branch: main
author: Duprat <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2025-05-19T20:06:09+05:30
summary:
gh-132795: Add docs for `multiprocessing.Semaphore.locked` (#133299)
files:
M Doc/library/multiprocessing.rst
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 6c43d5fe166e2f..80e33c4a1df015 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -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
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]