• en

Module OUnitShared

exception Lock_failure
type scope =
| ScopeGlobal
| ScopeProcess
type 'a shared_noscope = {
lock : 'a -> unit;
unlock : 'a -> unit;
try_lock : 'a -> bool;
}
type shared = {
global : int shared_noscope;
process : int shared_noscope;
}
val get_scoped : shared -> scope -> int shared_noscope
val mutex_create : unit -> unit shared_noscope Pervasives.ref
module Mutex : sig
type t = (int * scope)
val create : 'a -> (int * 'a)
val lock : shared -> (int * scope) -> unit
val try_lock : shared -> (int * scope) -> bool
val unlock : shared -> (int * scope) -> unit
val with_lock : shared -> (int * scope) -> unit -> 'a -> 'a
end
val noscope_create : unit -> 'a shared_noscope
val create : unit -> shared