source
structure Std.Barrier :
Type

A `Barrier` will block `n - 1` threads which call `Barrier.wait` and then wake up all threads at once when the `n`-th thread calls `Barrier.wait`.

- lock : Std.Mutex Std.BarrierState✝
- cvar : Std.Condvar
- numThreads : Nat

Instances For

source
def Std.Barrier.new (numThreads : Nat) :
BaseIO Barrier

Creates a new barrier that can block a given number of threads.

Equations

- One or more equations did not get rendered due to their size.

Instances For

source
def Std.Barrier.wait (barrier : Barrier) :
BaseIO Bool

Blocks the current thread until all threads have rendezvoused here.

Barriers are re-usable after all threads have rendezvoused once, and can be used continuously.

A single (arbitrary) thread will receive `true` when returning from this function, and all other threads will receive `false`.

Equations

- One or more equations did not get rendered due to their size.

Instances For