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

Method reset

Lib/asyncio/locks.py:577–590  ·  view source on GitHub ↗

Reset the barrier to the initial state. Any tasks currently waiting will get the BrokenBarrier exception raised.

(self)

Source from the content-addressed store, hash-verified

575 self._cond.notify_all()
576
577 async def reset(self):
578 """Reset the barrier to the initial state.
579
580 Any tasks currently waiting will get the BrokenBarrier exception
581 raised.
582 """
583 async with self._cond:
584 if self._count > 0:
585 if self._state is not _BarrierState.RESETTING:
586 #reset the barrier, waking up tasks
587 self._state = _BarrierState.RESETTING
588 else:
589 self._state = _BarrierState.FILLING
590 self._cond.notify_all()
591
592 async def abort(self):
593 """Place the barrier into a 'broken' state.

Callers 7

test_reprMethod · 0.95
test_reset_barrierMethod · 0.95
test_reversedMethod · 0.95
test_threadingMethod · 0.95

Calls 1

notify_allMethod · 0.45

Tested by 7

test_reprMethod · 0.76
test_reset_barrierMethod · 0.76
test_reversedMethod · 0.76
test_threadingMethod · 0.76