Crate semaphore [] [src]

Atomic counting semaphore that can help you control access to a common resource by multiple processes in a concurrent system.

Features

  • Fully lock-free* semantics
  • Provides RAII-style acquire/release API
  • Implements Send, Sync and Clone

* when not using the shutdown API

Structs

Guard

An RAII guard used to release a semaphore automatically when it falls out of scope.

Semaphore

An atomic counter which can be shared across processes.

ShutdownHandle

A handle representing the shutdown process of a semaphore.

UnguardedRef

An unguarded reference to a resource.

Enums

TryAccessError

An error indicating a failure to acquire access to the resource behind the semaphore.