Version 1.2.0
This is a preliminary version of the documentation. Help us to improve it by filling tickets. We are looking for native english speakers to proof read the documentation. Contact us!
module Lwt_mutex:sig..end
with_lock lock f is used to lock a mutex within a block scope. The function f () is called with the mutex locked, and its result is returned from the call to . If an exception is raised from f, the mutex is also unlocked before the scope of is exited.type t val create : unit -> tval lock : t -> unit Lwt.tval unlock : t -> unitval with_lock : t -> (unit -> 'a Lwt.t) -> 'a Lwt.twith_lock lock f is used to lock a mutex within a block scope. The function f () is called with the mutex locked, and its result is returned from the call to . If an exception is raised from f, the mutex is also unlocked before the scope of is exited.