File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ Threading-like synchronization primitives that can be used in Tasks.
186
186
* - :class: `BoundedSemaphore `
187
187
- A bounded semaphore.
188
188
189
+ * - :class: `Barrier `
190
+ - A barrier object.
191
+
189
192
190
193
.. rubric :: Examples
191
194
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ asyncio has the following basic synchronization primitives:
28
28
* :class: `Condition `
29
29
* :class: `Semaphore `
30
30
* :class: `BoundedSemaphore `
31
+ * :class: `Barrier `
31
32
32
33
33
34
---------
@@ -325,6 +326,22 @@ BoundedSemaphore
325
326
a :exc: `ValueError ` in :meth: `~Semaphore.release ` if it
326
327
increases the internal counter above the initial *value *.
327
328
329
+
330
+ Barrier
331
+ =======
332
+
333
+ .. class :: Barrier(parties, action=None)
334
+
335
+ A barrier object. Not thread-safe.
336
+
337
+ Create a barrier object for *parties * number of tasks. An *action *, when
338
+ provided, is a callable to be called by one of the tasks when they are
339
+ released.
340
+
341
+ A barrier object: a clone of :class: `threading.Barrier `.
342
+
343
+ .. versionadded :: 3.10
344
+
328
345
---------
329
346
330
347
You can’t perform that action at this time.
0 commit comments