Up

Module Async_mutex = Async_mutex

Signature

type t
val create : unit -> t
val lock : t -> unit Async.Std.Deferred.t

lock t returns a deferred that is fulfilled when the caller has acquired the mutex.

If the caller already holds the mutex, the deferred is never fulfilled. *

val try_lock : t -> [
| `Acquired
| `Not_acquired
]
val unlock : t -> unit
val resource : t -> (unit, Core.Std.Nothing.t) Resource.t