package duppy

  1. Overview
  2. Docs
type mutex

Type for a mutex.

val create : unit -> mutex

create () creates a mutex.

val lock : mutex -> (unit, 'a) t

A computation that locks a mutex * and returns unit afterwards. Computation * will be blocked until the mutex is sucessfuly locked.

val try_lock : mutex -> (bool, 'a) t

A computation that tries to lock a mutex. * Returns immediatly true if the mutex was sucesfully locked * or false otherwise.

val unlock : mutex -> (unit, 'a) t

A computation that unlocks a mutex. * Should return immediatly.

OCaml

Innovation. Community. Security.