Crate oncemutex

Source
Expand description

A mutex which can only be locked once, but which provides very fast concurrent reads after the first lock is over.

§Example


let mutex = OnceMutex::new(8);

// One-time lock
*mutex.lock().unwrap() = 9;

// Cheap lock-free access.
assert_eq!(*mutex, 9);

Structs§

  • A mutex which can only be locked once, but which provides very fast, lock-free, concurrent reads after the first lock is over.
  • A guard providing a one-time lock on a OnceMutex.