Skip to content

gh-132795: Add the new Locked public method to multiprocessing.[Bounded]Semaphore #133299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Loading