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:
sobolevn 2025-04-08 11:14:12 +03:00 committed by GitHub
parent 6cd1d6c6b1
commit f7305a06c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 89 additions and 6 deletions

View file

@ -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)}'