MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/threading.py:653–667  ·  view source on GitHub ↗

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 defa

(self, parties, action=None, timeout=None)

Source from the content-addressed store, hash-verified

651 """
652
653 def __init__(self, parties, action=None, timeout=None):
654 """Create a barrier, initialised to 'parties' threads.
655
656 'action' is a callable which, when supplied, will be called by one of
657 the threads after they have all entered the barrier and just prior to
658 releasing them all. If a 'timeout' is provided, it is used as the
659 default for all subsequent 'wait()' calls.
660
661 """
662 self._cond = Condition(Lock())
663 self._action = action
664 self._timeout = timeout
665 self._parties = parties
666 self._state = 0 # 0 filling, 1 draining, -1 resetting, -2 broken
667 self._count = 0
668
669 def __repr__(self):
670 cls = self.__class__

Callers

nothing calls this directly

Calls 2

ConditionClass · 0.70
LockClass · 0.50

Tested by

no test coverage detected