Reset the barrier to the initial state. Any threads currently waiting will get the BrokenBarrier exception raised.
(self)
| 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. |
nothing calls this directly
no test coverage detected