Crate smol::lock

source · []
Expand description

Async synchronization primitives.

This crate provides the following primitives:

  • Barrier - enables tasks to synchronize all together at the same time.
  • Mutex - a mutual exclusion lock.
  • RwLock - a reader-writer lock, allowing any number of readers or a single writer.
  • Semaphore - limits the number of concurrent operations.

Structs

A counter to synchronize multiple tasks at the same time.

Returned by Barrier::wait() when all tasks have called it.

An async mutex.

A guard that releases the mutex when dropped.

An owned guard that releases the mutex when dropped.

An async reader-writer lock.

A guard that releases the read lock when dropped.

A guard that releases the upgradable read lock when dropped.

A guard that releases the write lock when dropped.

A counter for limiting the number of concurrent operations.

A guard that releases the acquired permit.

An owned guard that releases the acquired permit.