Skip to main content

Module lock

Module lock 

Source
Expand description

A module containing lock_api-based lock types that are or are not Send + Sync depending on whether the threading feature of this module is enabled.

Structs§

ImmutableMappedMutexGuard
A mutex guard that has an exclusive lock, but only an immutable reference; useful if you need to map a mutex guard with a function that returns an &T. Construct using the MapImmutable trait.
LazyCell
A value which is initialized on the first access.
LazyLock
A value which is initialized on the first access.
MappedThreadMutexGuard
OnceCell
A cell which can nominally be written to only once.
RawMutex
RawRwLock
RawThreadId
RawThreadMutex
A mutex type that knows when it would deadlock
ThreadMutex
ThreadMutexGuard

Enums§

TryLockThreadError

Traits§

MapImmutable

Functions§

reinit_mutex_after_fork
Reset a PyMutex after fork(). See zero_reinit_after_fork.
reinit_rwlock_after_fork
Reset a PyRwLock after fork(). See zero_reinit_after_fork.
reinit_thread_mutex_after_fork
Reset a PyThreadMutex to its initial (unlocked, unowned) state after fork().
zero_reinit_after_fork
Reset a lock to its initial (unlocked) state by zeroing its bytes.

Type Aliases§

PyImmutableMappedMutexGuard
PyMappedMutexGuard
PyMappedRwLockReadGuard
PyMappedRwLockWriteGuard
PyMappedThreadMutexGuard
PyMutex
PyMutexGuard
PyRwLock
PyRwLockReadGuard
PyRwLockUpgradableReadGuard
PyRwLockWriteGuard
PyThreadMutex
PyThreadMutexGuard