Crate parking_lot

source ·
Expand description

This library provides implementations of Mutex, RwLock, Condvar and Once that are smaller, faster and more flexible than those in the Rust standard library. It also provides a ReentrantMutex type.

Re-exports§

Modules§

  • [Experimental] Deadlock detection

Structs§

  • An RAII mutex guard returned by the Arc locking operations on Mutex.
  • An RAII mutex guard returned by the Arc locking operations on ReentrantMutex.
  • An RAII rwlock guard returned by the Arc locking operations on RwLock.
  • An RAII rwlock guard returned by the Arc locking operations on RwLock. This is similar to the RwLockUpgradableReadGuard struct, except instead of using a reference to unlock the RwLock it uses an Arc<RwLock>. This has several advantages, most notably that it has an 'static lifetime.
  • An RAII rwlock guard returned by the Arc locking operations on RwLock. This is similar to the RwLockWriteGuard struct, except instead of using a reference to unlock the RwLock it uses an Arc<RwLock>. This has several advantages, most notably that it has an 'static lifetime.
  • A Condition Variable
  • A synchronization primitive which can be used to run a one-time initialization. Useful for one-time initialization for globals, FFI or related functionality.
  • Raw fair mutex type backed by the parking lot.
  • Raw mutex type backed by the parking lot.
  • Raw reader-writer lock type backed by the parking lot.
  • Implementation of the GetThreadId trait for lock_api::ReentrantMutex.
  • A type indicating whether a timed wait on a condition variable returned due to a time out or not.

Enums§

Functions§

Type Aliases§

  • A mutual exclusive primitive that is always fair, useful for protecting shared data
  • An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
  • An RAII mutex guard returned by FairMutexGuard::map, which can point to a subfield of the protected data.
  • An RAII mutex guard returned by MutexGuard::map, which can point to a subfield of the protected data.
  • An RAII mutex guard returned by ReentrantMutexGuard::map, which can point to a subfield of the protected data.
  • An RAII read lock guard returned by RwLockReadGuard::map, which can point to a subfield of the protected data.
  • An RAII write lock guard returned by RwLockWriteGuard::map, which can point to a subfield of the protected data.
  • A mutual exclusion primitive useful for protecting shared data
  • An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
  • A mutex which can be recursively locked by a single thread.
  • An RAII implementation of a “scoped lock” of a reentrant mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
  • A reader-writer lock
  • RAII structure used to release the shared read access of a lock when dropped.
  • RAII structure used to release the upgradable read access of a lock when dropped.
  • RAII structure used to release the exclusive write access of a lock when dropped.