MCPcopy Index your code
hub / github.com/RustPython/RustPython / wait

Method wait

Lib/threading.py:651–671  ·  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

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

Callers 13

shutdownMethod · 0.45
closeMethod · 0.45
acquireMethod · 0.45
_enterMethod · 0.45
startMethod · 0.45
runMethod · 0.45
shutdownMethod · 0.45
joinMethod · 0.45
putMethod · 0.45
getMethod · 0.45
runFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected