package index

  1. Overview
  2. Docs
A platform-agnostic multi-level index for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

index-1.3.2.tbz
sha256=0e46ebc785eb5b947bcb6e04075dda694d7e951c5ac51103e4d5fa5105df5d14
sha512=fd82ba852bb43eae8fefca2563d114bc2fa99e0ba98c828bccc2e81737a05156297b64b5894e2d0a58457a3382730a34e16cf16c844f8a6e6844c2684d79c7b5

doc/index/Index/Private/Make/argument-4-_/index.html

Parameter Make._

Binary semaphores for mutual exclusion

type t

The type of binary semaphore.

val make : bool -> t

make b returns a new semaphore with the given initial state. If b is true, the semaphore is initially available for acquisition; otherwise, the semaphore is initially unavailable.

val acquire : string -> t -> unit

Acquire the given semaphore. Acquisition is not re-entrant.

val release : t -> unit

Release the given semaphore. If any threads are attempting to acquire the semaphore, exactly one of them will gain access to the semaphore.

val with_acquire : string -> t -> (unit -> 'a) -> 'a

with_acquire t f first obtains t, then computes f (), and finally release t.

val is_held : t -> bool

is_held t returns true if the semaphore is held, without acquiring t.

OCaml

Innovation. Community. Security.