Up

Module Mutex0

Signature

include Mutex

create like Mutex.create, but creates an error-checking mutex. Locking a mutex twice from the same thread, unlocking an unlocked mutex, or unlocking a mutex not held by the thread will result in a Sys_error exception.

external create : unit -> Mutex.t = "unix_create_error_checking_mutex"
val create : unit -> Mutex.t
val phys_equal : 'a -> 'a -> bool
val equal : t -> t -> bool
val critical_section : t -> f:(unit -> 'a) -> 'a
val synchronize : ('a -> 'b) -> 'a -> 'b
val update_signal : t -> Condition.t -> f:(unit -> 'a) -> 'a
val update_broadcast : t -> Condition.t -> f:(unit -> 'a) -> 'a
val try_lock : t -> [>
| `Acquired
| `Already_held_by_me_or_other
]