| 196 | # |
| 197 | |
| 198 | class RLock(SemLock): |
| 199 | |
| 200 | def __init__(self, *, ctx): |
| 201 | SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx) |
| 202 | |
| 203 | def __repr__(self): |
| 204 | try: |
| 205 | if self._semlock._is_mine(): |
| 206 | name = process.current_process().name |
| 207 | if threading.current_thread().name != 'MainThread': |
| 208 | name += '|' + threading.current_thread().name |
| 209 | count = self._semlock._count() |
| 210 | elif not self._semlock._is_zero(): |
| 211 | name, count = 'None', 0 |
| 212 | elif self._semlock._count() > 0: |
| 213 | name, count = 'SomeOtherThread', 'nonzero' |
| 214 | else: |
| 215 | name, count = 'SomeOtherProcess', 'nonzero' |
| 216 | except Exception: |
| 217 | name, count = 'unknown', 'unknown' |
| 218 | return '<%s(%s, %s)>' % (self.__class__.__name__, name, count) |
| 219 | |
| 220 | # |
| 221 | # Condition variable |
no outgoing calls
no test coverage detected
searching dependent graphs…