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

Method reset

Lib/threading.py:785–803  ·  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

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

Callers

nothing calls this directly

Calls 1

notify_allMethod · 0.45

Tested by

no test coverage detected