Release a lock, decrementing the recursion level. If after the decrement it is zero, reset the lock to unlocked (not owned by any thread), and if any other threads are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. If after the
(self)
| 210 | __enter__ = acquire |
| 211 | |
| 212 | def release(self): |
| 213 | """Release a lock, decrementing the recursion level. |
| 214 | |
| 215 | If after the decrement it is zero, reset the lock to unlocked (not owned |
| 216 | by any thread), and if any other threads are blocked waiting for the |
| 217 | lock to become unlocked, allow exactly one of them to proceed. If after |
| 218 | the decrement the recursion level is still nonzero, the lock remains |
| 219 | locked and owned by the calling thread. |
| 220 | |
| 221 | Only call this method when the calling thread owns the lock. A |
| 222 | RuntimeError is raised if this method is called when the lock is |
| 223 | unlocked. |
| 224 | |
| 225 | There is no return value. |
| 226 | |
| 227 | """ |
| 228 | if self._owner != get_ident(): |
| 229 | raise RuntimeError("cannot release un-acquired lock") |
| 230 | self._count = count = self._count - 1 |
| 231 | if not count: |
| 232 | self._owner = None |
| 233 | self._block.release() |
| 234 | |
| 235 | def __exit__(self, t, v, tb): |
| 236 | self.release() |
no outgoing calls
no test coverage detected