MCPcopy Index your code
hub / github.com/RustPython/RustPython / reset

Method reset

Lib/threading.py:792–810  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

790 self._cond.notify_all()
791
792 def reset(self):
793 """Reset the barrier to the initial state.
794
795 Any threads currently waiting will get the BrokenBarrier exception
796 raised.
797
798 """
799 with self._cond:
800 if self._count > 0:
801 if self._state == 0:
802 #reset the barrier, waking up threads
803 self._state = -1
804 elif self._state == -2:
805 #was broken, set it to reset state
806 #which clears when the last thread exits
807 self._state = -1
808 else:
809 self._state = 0
810 self._cond.notify_all()
811
812 def abort(self):
813 """Place the barrier into a 'broken' state.

Callers

nothing calls this directly

Calls 1

notify_allMethod · 0.45

Tested by

no test coverage detected