MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / release

Method release

tools/python-3.11.9-amd64/Lib/threading.py:176–197  ·  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

(self)

Source from the content-addressed store, hash-verified

174 __enter__ = acquire
175
176 def release(self):
177 """Release a lock, decrementing the recursion level.
178
179 If after the decrement it is zero, reset the lock to unlocked (not owned
180 by any thread), and if any other threads are blocked waiting for the
181 lock to become unlocked, allow exactly one of them to proceed. If after
182 the decrement the recursion level is still nonzero, the lock remains
183 locked and owned by the calling thread.
184
185 Only call this method when the calling thread owns the lock. A
186 RuntimeError is raised if this method is called when the lock is
187 unlocked.
188
189 There is no return value.
190
191 """
192 if self._owner != get_ident():
193 raise RuntimeError("cannot release un-acquired lock")
194 self._count = count = self._count - 1
195 if not count:
196 self._owner = None
197 self._block.release()
198
199 def __exit__(self, t, v, tb):
200 self.release()

Callers 12

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

Calls

no outgoing calls

Tested by

no test coverage detected