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

Method _wake_up_next

Lib/asyncio/locks.py:437–448  ·  view source on GitHub ↗

Wake up the first waiter that isn't done.

(self)

Source from the content-addressed store, hash-verified

435 self._wake_up_next()
436
437 def _wake_up_next(self):
438 """Wake up the first waiter that isn't done."""
439 if not self._waiters:
440 return False
441
442 for fut in self._waiters:
443 if not fut.done():
444 self._value -= 1
445 fut.set_result(True)
446 # `fut` is now `done()` and not `cancelled()`.
447 return True
448 return False
449
450
451class BoundedSemaphore(Semaphore):

Callers 2

acquireMethod · 0.95
releaseMethod · 0.95

Calls 2

doneMethod · 0.45
set_resultMethod · 0.45

Tested by

no test coverage detected