8000 bpo-43352: Add a Barrier object to asyncio synchronized primitives (G… · python/cpython@fe20bdc · GitHub
[go: up one dir, main page]

Skip to content

Commit fe20bdc

Browse files
YvesDup1st1
andauthored
bpo-43352: Add a Barrier object to asyncio synchronized primitives (GH-24903)
Co-authored-by: Yury Selivanov <yury@edgedb.com>
1 parent c7bbebe commit fe20bdc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/asyncio-sync.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ Barrier
349349

350350
A barrier object. Not thread-safe.
351351

352-
This class, as a clone of :class:`threading.Barrier`, provides a simple synchronization
353-
primitive for use by a fixed number of tasks that need to wait for each other.
354-
Each of the tasks tries to pass the barrier by calling the :meth:`~Barrier.wait` method
355-
and would block until all of the tasks have made their :meth:`~Barrier.wait` calls.
356-
At this point, the tasks are released simultaneously.
352+
A barrier is a simple synchronization primitive that allows to block until a
353+
certain number of tasks are waiting on it.
354+
Tasks can wait on the :meth:`~Barrier.wait` method and would be blocked until
355+
the specified number of tasks end up waiting on :meth:`~Barrier.wait`.
356+
At that point all of the waiting tasks would unblock simultaneously.
357357

358358
The barrier can be reused any number of times.
359359

0 commit comments

Comments
 (0)
0