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

Method release

tools/python-3.11.9-amd64/Lib/asyncio/locks.py:125–140  ·  view source on GitHub ↗

Release a lock. When the lock is locked, reset it to unlocked, and return. If any other coroutines are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. When invoked on an unlocked lock, a RuntimeError is raised.

(self)

Source from the content-addressed store, hash-verified

123 return True
124
125 def release(self):
126 """Release a lock.
127
128 When the lock is locked, reset it to unlocked, and return.
129 If any other coroutines are blocked waiting for the lock to become
130 unlocked, allow exactly one of them to proceed.
131
132 When invoked on an unlocked lock, a RuntimeError is raised.
133
134 There is no return value.
135 """
136 if self._locked:
137 self._locked = False
138 self._wake_up_first()
139 else:
140 raise RuntimeError('Lock is not acquired.')
141
142 def _wake_up_first(self):
143 """Wake up the first waiter if it isn't done."""

Callers 13

__aexit__Method · 0.45
waitMethod · 0.45
releaseMethod · 0.45
add_cookie_headerMethod · 0.45
set_cookie_if_okMethod · 0.45
set_cookieMethod · 0.45
extract_cookiesMethod · 0.45
clear_session_cookiesMethod · 0.45
clear_expired_cookiesMethod · 0.45
revertMethod · 0.45
__exit__Method · 0.45
_workerFunction · 0.45

Calls 1

_wake_up_firstMethod · 0.95

Tested by

no test coverage detected