module CyclicBarrier:sig
..end
type
t
val make : int32 -> t
make n
returns a barrier waiting for n
threads.
Raises Invalid_argument
if n
is negative.
val await : t -> int32
Raises Invalid_argument
if the barrier is broken.
Raises Runtime.Interrupted
if the thread is interrupted.
val await_time : t -> int64 -> TimeUnit.t -> int32
await_time b t u
is similar to await b
, except that the current
thread will at most wait for t
(time value whose unit is u
).
Raises Invalid_argument
if the barrier is broken.
Raises Runtime.Interrupted
if the thread is interrupted.
Raises Runtime.Timeout
if time has elapsed without gathering all
threads.
val get_number_waiting : t -> int32
val get_parties : t -> int32
val is_broken : t -> bool
reset
when threads are waiting on it.val reset : t -> unit