package picos_std

  1. Overview
  2. Docs

Module Semaphore.BinarySource

A binary semaphore.

Sourcetype t

Represents a binary semaphore.

Sourceval make : ?padded:bool -> bool -> t

make initial creates a new binary semaphore with count of 1 in case initial is true and count of 0 otherwise.

Sourceval release : t -> unit

release semaphore sets the count of the semaphore to 1.

Sourceval acquire : t -> unit

acquire semaphore waits until the count of the semaphore is 1 and then atomically changes the count to 0.

Sourceval try_acquire : t -> bool

try_acquire semaphore attempts to atomically change the count of the semaphore from 1 to 0.

OCaml

Innovation. Community. Security.