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

Method wait

tools/python-3.11.9-amd64/Lib/asyncio/locks.py:481–502  ·  view source on GitHub ↗

Wait for the barrier. When the specified number of tasks have started waiting, they are all simultaneously awoken. Returns an unique and individual index number from 0 to 'parties-1'.

(self)

Source from the content-addressed store, hash-verified

479 pass
480
481 async def wait(self):
482 """Wait for the barrier.
483
484 When the specified number of tasks have started waiting, they are all
485 simultaneously awoken.
486 Returns an unique and individual index number from 0 to 'parties-1'.
487 """
488 async with self._cond:
489 await self._block() # Block while the barrier drains or resets.
490 try:
491 index = self._count
492 self._count += 1
493 if index + 1 == self._parties:
494 # We release the barrier
495 await self._release()
496 else:
497 await self._wait()
498 return index
499 finally:
500 self._count -= 1
501 # Wake up any tasks waiting for barrier to drain.
502 self._exit()
503
504 async def _block(self):
505 # Block until the barrier is ready for us,

Callers 1

__aenter__Method · 0.95

Calls 4

_blockMethod · 0.95
_releaseMethod · 0.95
_waitMethod · 0.95
_exitMethod · 0.95

Tested by

no test coverage detected