MCPcopy Index your code
hub / github.com/RustPython/RustPython / release

Method release

Lib/threading.py:219–240  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 11

__exit__Method · 0.95
_release_saveMethod · 0.45
_release_saveMethod · 0.45
_is_ownedMethod · 0.45
notifyMethod · 0.45
_internal_pollMethod · 0.45
_waitMethod · 0.45
_get_candidate_namesFunction · 0.45
_gettempdirFunction · 0.45
putMethod · 0.45
test_resizableFunction · 0.45

Calls 1

get_identFunction · 0.70

Tested by 1

test_resizableFunction · 0.36