MCPcopy Index your code
hub / github.com/python/cpython / _wake_up_first

Method _wake_up_first

Lib/asyncio/locks.py:144–155  ·  view source on GitHub ↗

Ensure that the first waiter will wake up.

(self)

Source from the content-addressed store, hash-verified

142 raise RuntimeError('Lock is not acquired.')
143
144 def _wake_up_first(self):
145 """Ensure that the first waiter will wake up."""
146 if not self._waiters:
147 return
148 try:
149 fut = next(iter(self._waiters))
150 except StopIteration:
151 return
152
153 # .done() means that the waiter is already set to wake up.
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