package duppy

  1. Overview
  2. Docs

Parameters

Signature

type condition

Type of a condition, used in wait and broadcast

val create : unit -> condition

Create a condition. Implementation-wise, * a duppy task is created that will be used to select a * waiting computation, and resume it. * Thus, priority and s represents, resp., the priority * and scheduler used when running calling process' computation.

val wait : condition -> Mutex.mutex -> (unit, 'a) t

wait h m is a computation that: *

  • Unlock mutex m
  • Wait until Condition.signal c or Condition.broadcast c has been called
  • Locks mutex m
  • Returns unit
val broadcast : condition -> (unit, 'a) t

broadcast c is a computation that * resumes all computations waiting on c. It should * return immediately.

val signal : condition -> (unit, 'a) t

signal c is a computation that resumes one * computation waiting on c. It should return * immediately.

OCaml

Innovation. Community. Security.