package qcow

  1. Overview
  2. Docs
type t

A lock which permits multiple concurrent threads to acquire it for reading but demands exclusivity for writing

val make : unit -> t

Create a RW lock

val with_read_lock : t -> (unit -> 'a Lwt.t) -> 'a Lwt.t

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

val with_write_lock : t -> (unit -> 'a Lwt.t) -> 'a Lwt.t

with_write_lock t f executes f () with the lock held for writing

OCaml

Innovation. Community. Security.