diff options
author | sobolevn <mail@sobolevn.me> | 2025-04-08 08:14:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 08:14:12 (GMT) |
commit | f7305a06c7a322d23b39ad9d16af814d467624c6 (patch) | |
tree | 8a25dede6c059e01ae98c63d737ac0d0c1987b58 /Lib/multiprocessing/managers.py | |
parent | 6cd1d6c6b142697fb72f422b7b448c27ebc30534 (diff) | |
download | cpython-f7305a06c7a322d23b39ad9d16af814d467624c6.zip cpython-f7305a06c7a322d23b39ad9d16af814d467624c6.tar.gz cpython-f7305a06c7a322d23b39ad9d16af814d467624c6.tar.bz2 |
gh-115942: Add `locked` to several multiprocessing locks (#115944)
Co-authored-by: mpage <mpage@cs.stanford.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Diffstat (limited to 'Lib/multiprocessing/managers.py')
-rw-r--r-- | Lib/multiprocessing/managers.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index c1f09d2..91bcf24 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -1059,12 +1059,14 @@ class IteratorProxy(BaseProxy): class AcquirerProxy(BaseProxy): - _exposed_ = ('acquire', 'release') + _exposed_ = ('acquire', 'release', 'locked') def acquire(self, blocking=True, timeout=None): args = (blocking,) if timeout is None else (blocking, timeout) return self._callmethod('acquire', args) def release(self): return self._callmethod('release') + def locked(self): + return self._callmethod('locked') def __enter__(self): return self._callmethod('acquire') def __exit__(self, exc_type, exc_val, exc_tb): @@ -1072,7 +1074,7 @@ class AcquirerProxy(BaseProxy): class ConditionProxy(AcquirerProxy): - _exposed_ = ('acquire', 'release', 'wait', 'notify', 'notify_all') + _exposed_ = ('acquire', 'release', 'locked', 'wait', 'notify', 'notify_all') def wait(self, timeout=None): return self._callmethod('wait', (timeout,)) def notify(self, n=1): |