MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / reset

Method reset

tools/python-3.11.9-amd64/Lib/threading.py:749–767  ·  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

747 self._cond.notify_all()
748
749 def reset(self):
750 """Reset the barrier to the initial state.
751
752 Any threads currently waiting will get the BrokenBarrier exception
753 raised.
754
755 """
756 with self._cond:
757 if self._count > 0:
758 if self._state == 0:
759 #reset the barrier, waking up threads
760 self._state = -1
761 elif self._state == -2:
762 #was broken, set it to reset state
763 #which clears when the last thread exits
764 self._state = -1
765 else:
766 self._state = 0
767 self._cond.notify_all()
768
769 def abort(self):
770 """Place the barrier into a 'broken' state.

Callers

nothing calls this directly

Calls 1

notify_allMethod · 0.45

Tested by

no test coverage detected