MCPcopy Index your code
hub / github.com/python/cpython / wait

Method wait

Lib/threading.py:644–664  ·  view source on GitHub ↗

Block until the internal flag is true. If the internal flag is true on entry, return immediately. Otherwise, block until another thread calls set() to set the flag to true, or until the optional timeout occurs. When the timeout argument is present and not None, it s

(self, timeout=None)

Source from the content-addressed store, hash-verified

642 self._flag = False
643
644 def wait(self, timeout=None):
645 """Block until the internal flag is true.
646
647 If the internal flag is true on entry, return immediately. Otherwise,
648 block until another thread calls set() to set the flag to true, or until
649 the optional timeout occurs.
650
651 When the timeout argument is present and not None, it should be a
652 floating-point number specifying a timeout for the operation in seconds
653 (or fractions thereof).
654
655 This method returns the internal flag on exit, so it will always return
656 ``True`` except if a timeout is given and the operation times out, when
657 it will return ``False``.
658
659 """
660 with self._cond:
661 signaled = self._flag
662 if not signaled:
663 signaled = self._cond.wait(timeout)
664 return signaled
665
666
667# A barrier class. Inspired in part by the pthread_barrier_* api and

Callers 15

async_processFunction · 0.45
logcat_taskFunction · 0.45
gradle_taskFunction · 0.45
syncSleepFunction · 0.45
promptMethod · 0.45
shutdownMethod · 0.45
closeMethod · 0.45
acquireMethod · 0.45
_enterMethod · 0.45
startMethod · 0.45
runMethod · 0.45
shutdownMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected