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

Method _wake_up_first

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

Wake up the first waiter if it isn't done.

(self)

Source from the content-addressed store, hash-verified

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."""
144 if not self._waiters:
145 return
146 try:
147 fut = next(iter(self._waiters))
148 except StopIteration:
149 return
150
151 # .done() necessarily means that a waiter will wake up later on and
152 # either take the lock, or, if it was cancelled and lock wasn't
153 # taken already, will hit this again and wake up a new waiter.
154 if not fut.done():
155 fut.set_result(True)
156
157
158class Event(mixins._LoopBoundMixin):

Callers 2

acquireMethod · 0.95
releaseMethod · 0.95

Calls 2

doneMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected