module CountDownLatch: sig .. end
Countdown synchronization.
type t
The type of countdown latches, that are barrier-like synchronization
entities.
val make : int32 -> t
make n
returns a countdown latch waiting for n
threads.
Raises Invalid_argument
if n
is negative.
val await : t -> unit
Waits until the coutdown reaches zero, without countingdown.
Raises Runtime.Interrupted
if the thread is interrupted.
val await_time : t -> int64 -> TimeUnit.t -> bool
await_time c t u
is similar to await c
, except that the current
thread will at most wait for t
(time value whose unit is u
).
Raises Runtime.Interrupted
if the thread is interrupted.
val count_down : t -> unit
Decrements the count, and then waits for the countdown to reach zero.
val get_count : t -> int64
Returns the current count.