package qcow

  1. Overview
  2. Docs

Non-exclusive read locks

val with_lock : ?client:Client.t -> t -> Qcow_types.Cluster.t -> (unit -> 'a Lwt.t) -> 'a Lwt.t

with_lock t f executes f () with the lock held for reading

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 executes f () with all clusters in the interval first .. last inclusive locked for reading.

val lock : ?client:Client.t -> t -> Qcow_types.Cluster.t -> lock Lwt.t

lock t cluster acquire a non-exclusive read lock on cluster. The resulting lock must be released by calling unlock


Innovation. Community. Security.