diff options
Diffstat (limited to 'Lib/threading.py')
| -rw-r--r-- | Lib/threading.py | 15 | 
1 files changed, 9 insertions, 6 deletions
| diff --git a/Lib/threading.py b/Lib/threading.py index 56a4060..828019d 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -3,10 +3,7 @@  import sys as _sys  import _thread -try: -    from time import monotonic as _time -except ImportError: -    from time import time as _time +from time import monotonic as _time  from traceback import format_exc as _format_exc  from _weakrefset import WeakSet  from itertools import islice as _islice, count as _count @@ -106,8 +103,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. | 
