[3.14] gh-132795: Add docs for multiprocessing.Semaphore.locked (GH-133299) (#142111)

Co-authored-by: Duprat <yduprat@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-11-30 13:19:30 +01:00 committed by GitHub
parent 3d448061a1
commit 1011c0c38f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1419,6 +1419,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.
@ -1571,6 +1577,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