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