package containers-thread

  1. Overview
  2. Docs

Module CCThread.BarrierSource

Sourcetype t

Barrier, used to synchronize threads

Sourceval create : unit -> t

Create a barrier.

Sourceval reset : t -> unit

Reset to initial (non-triggered) state.

Sourceval wait : t -> unit

wait b waits for barrier b to be activated by activate b. All threads calling this wait until activate b is called. If b is already activated, wait b does nothing.

Sourceval activate : t -> unit

activate b unblocks all threads that were waiting on b.

Sourceval activated : t -> bool

activated b returns true iff activate b was called, and reset b was not called since. In other words, activated b = true means wait b will not block.

OCaml

Innovation. Community. Security.