summaryrefslogtreecommitdiff
path: root/Lib/threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 34070830e7..c7c4478178 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -106,8 +106,14 @@ class _RLock:
owner = _active[owner].name
except KeyError:
pass
- return "<%s owner=%r count=%d>" % (
- self.__class__.__name__, owner, self._count)
+ return "<%s %s.%s object owner=%r count=%d at %s>" % (
+ "locked" if self._block.locked() else "unlocked",
+ self.__class__.__module__,
+ self.__class__.__qualname__,
+ owner,
+ self._count,
+ hex(id(self))
+ )
def acquire(self, blocking=True, timeout=-1):
"""Acquire a lock, blocking or non-blocking.