package picos_std

  1. Overview
  2. Docs
Sample libraries for Picos

Install

Dune Dependency

Authors

Maintainers

Sources

picos-0.6.0.tbz
sha256=3f5a08199cf65c2dae2f7d68f3877178f1da8eabf5376e15114e5a8958087dfa
sha512=ad24910c47ce614268c4268874bb918da7f8b5f03b3ad706bbf30323635262e94ddab6be24eaebbca706bfa82c0a517d4272b396459e020c185942125c9bdb7b

doc/picos_std.sync/Picos_std_sync/Semaphore/Binary/index.html

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.

ℹ️ This operation is not cancelable.

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.