Module Qcow_locks.Write
val with_lock : ?client:Client.t -> t -> Qcow_types.Cluster.t -> (unit -> 'a Lwt.t) -> 'a Lwt.t
with_lock t f
executesf ()
with the lock held for writing
val with_locks : ?client:Client.t -> t -> first:Qcow_types.Cluster.t -> last:Qcow_types.Cluster.t -> (unit -> 'a Lwt.t) -> 'a Lwt.t
with_locks t ~first ~last f
executesf ()
with all clusters in the intervalfirst .. last
inclusive locked for writing.
val try_lock : ?client:Client.t -> t -> Qcow_types.Cluster.t -> lock option
try_lock ?client t cluster
returns a write lock oncluster
if it can be done without blocking, or returns None.