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

Method _block

Lib/asyncio/locks.py:534–548  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

532 self._exit()
533
534 async def _block(self):
535 # Block until the barrier is ready for us,
536 # or raise an exception if it is broken.
537 #
538 # It is draining or resetting, wait until done
539 # unless a CancelledError occurs
540 await self._cond.wait_for(
541 lambda: self._state not in (
542 _BarrierState.DRAINING, _BarrierState.RESETTING
543 )
544 )
545
546 # see if the barrier is in a broken state
547 if self._state is _BarrierState.BROKEN:
548 raise exceptions.BrokenBarrierError("Barrier aborted")
549
550 async def _release(self):
551 # Release the tasks waiting in the barrier.

Callers 1

waitMethod · 0.95

Calls 1

wait_forMethod · 0.45

Tested by

no test coverage detected