containers.thread
CCThread.Barrier
containers
containers.data
containers.iter
containers.monomorphic
containers.sexp
containers.top
containers.unix
type t
Barrier, used to synchronize threads
val create : unit -> t
Create a barrier.
val reset : t -> unit
Reset to initial (non-triggered) state.
val 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.
wait b
b
activate b
val activate : t -> unit
activate b unblocks all threads that were waiting on b.
val 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.
activated b
true
reset b
activated b = true