Create a barrier, initialised to 'parties' tasks.
(self, parties)
| 483 | """ |
| 484 | |
| 485 | def __init__(self, parties): |
| 486 | """Create a barrier, initialised to 'parties' tasks.""" |
| 487 | if parties < 1: |
| 488 | raise ValueError('parties must be >= 1') |
| 489 | |
| 490 | self._cond = Condition() # notify all tasks when state changes |
| 491 | |
| 492 | self._parties = parties |
| 493 | self._state = _BarrierState.FILLING |
| 494 | self._count = 0 # count tasks in Barrier |
| 495 | |
| 496 | def __repr__(self): |
| 497 | res = super().__repr__() |