aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/multiprocessing/synchronize.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/multiprocessing/synchronize.py')
-rw-r--r--Lib/multiprocessing/synchronize.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py
index edd6c2543a7..771f1db8813 100644
--- a/Lib/multiprocessing/synchronize.py
+++ b/Lib/multiprocessing/synchronize.py
@@ -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__()