Available on crate features
os
and os_unix_mutex
only.Expand description
A mutual exclusion primitive useful for protecting shared data.
Structs§
- NSTD
Unix Mutex - A mutual exclusion primitive useful for protecting shared data.
- NSTD
Unix Mutex Guard - A handle to a mutex’s protected data.
Functions§
- nstd_
os_ ⚠unix_ mutex_ drop - Frees an instance of
NSTDUnixMutex
after invokingcallback
with the mutex’s data. - nstd_
os_ unix_ mutex_ free - Frees an instance of
NSTDUnixMutex
. - nstd_
os_ unix_ mutex_ get - Returns a pointer to a mutex’s raw data.
- nstd_
os_ unix_ mutex_ get_ mut - Returns a mutable pointer to a mutex’s raw data.
- nstd_
os_ unix_ mutex_ handle - Returns a Unix mutex’s native OS handle.
- nstd_
os_ unix_ mutex_ into_ inner - Consumes a mutex and returns the data it was protecting.
- nstd_
os_ unix_ mutex_ is_ poisoned - Determines whether or not a mutex’s data is poisoned.
- nstd_
os_ unix_ mutex_ lock - Waits for a mutex lock to become acquired, returning a guard wrapping the protected data.
- nstd_
os_ unix_ mutex_ new - Creates a new mutex in an unlocked state.
- nstd_
os_ unix_ mutex_ timed_ lock - The timed variant of
nstd_os_unix_mutex_lock
. This will return with an uninitialized “none” value if the mutex remains locked for the time span ofduration
. - nstd_
os_ unix_ mutex_ try_ lock - The non-blocking variant of
nstd_os_unix_mutex_lock
. This will return immediately with an uninitialized “none” value if the mutex is locked. - nstd_
os_ unix_ mutex_ unlock - Unlocks a mutex by consuming it’s guard.
Type Aliases§
- NSTD
Unix Mutex Lock Result - A result type returned from
nstd_os_unix_mutex_lock
containing the mutex guard whether or not the data is poisoned. - NSTD
Unix Optional Mutex - Represents an optional value of type
NSTDUnixMutex
. - NSTD
Unix Optional Mutex Lock Result - An optional value of type
NSTDUnixMutexLockResult
.