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