package duppy

  1. Overview
  2. Docs

Module Mutex.FactorySource

Parameters

Signature

Sourcetype mutex

Type for a mutex.

Sourceval create : unit -> mutex

create () creates a mutex.

Sourceval 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.

Sourceval 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.

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

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

OCaml

Innovation. Community. Security.