mirror of
https://github.com/python/cpython.git
synced 2025-09-11 03:07:01 +00:00
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>
This commit is contained in:
parent
6cd1d6c6b1
commit
f7305a06c7
10 changed files with 89 additions and 6 deletions
|
@ -90,6 +90,9 @@ class SemLock(object):
|
|||
self.acquire = self._semlock.acquire
|
||||
self.release = self._semlock.release
|
||||
|
||||
def locked(self):
|
||||
return self._semlock._count() != 0
|
||||
|
||||
def __enter__(self):
|
||||
return self._semlock.__enter__()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue