mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +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
|
@ -382,6 +382,9 @@ class _ModuleLock:
|
|||
self.waiters.pop()
|
||||
self.wakeup.release()
|
||||
|
||||
def locked(self):
|
||||
return bool(self.count)
|
||||
|
||||
def __repr__(self):
|
||||
return f'_ModuleLock({self.name!r}) at {id(self)}'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue