(self, parties, action=None, timeout=None)
Create a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.
Create a barrier, initialised to 'parties' threads.
Create a barrier initialised to parties threads .
def __init__(self, parties, action=None, timeout=None):
        """Create a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        """
        self._cond = Condition(Lock())
        self._action = action
        self._timeout = timeout
        self._parties = parties
        self._state = 0  # 0 filling, 1 draining, -1 resetting, -2 broken
        self._count = 0
def __init__ ( self , parties , action = None , timeout = None ) : self . _cond = Condition ( Lock ( ) ) self . _action = action self . _timeout = timeout self . _parties = parties self . _state = 0 # 0 filling, 1 draining, -1 resetting, -2 broken self . _count = 0