Crate nospin

Crate nospin 

Source
Expand description

This crate provides non thread-safe versions of the primitives in std::sync and std::lazy suitable for use in single-threaded no_std environments.

§Features

  • Mutex, RwLock, Once/SyncOnceCell, and SyncLazy equivalents

  • Support for no_std environments

  • lock_api compatibility

  • Upgradeable RwLock guards

  • Guards can be sent and shared between threads

  • Guard leaking

§Relationship with std::sync

While spin is not a drop-in replacement for std::sync an effort has been made to keep this crate reasonably consistent with std::sync.

§Feature flags

The crate comes with a few feature flags that you may wish to use.

Re-exports§

pub use lazy::Lazy;lazy
pub use mutex::Mutex;mutex
pub use mutex::MutexGuard;mutex
pub use once::Once;once
pub use rwlock::RwLock;rwlock
pub use rwlock::RwLockReadGuard;rwlock
pub use rwlock::RwLockUpgradableGuard;rwlock
pub use rwlock::RwLockWriteGuard;rwlock

Modules§

lazylazy
Synchronization primitives for lazy evaluation.
lock_apilock_api
Spin synchronisation primitives, but compatible with lock_api.
mutexmutex
Locks that have the same behaviour as a mutex.
onceonce
Synchronization primitives for one-time evaluation.
rwlockrwlock
A lock that provides data access to either one writer or many readers.