Module mutex

Module mutex 

Source
Available on crate feature mutex only.
Expand description

A mutual exclusion primitive useful for protecting shared data.

Structs§

NSTDMutex
A mutual exclusion primitive useful for protecting shared data.
NSTDMutexGuard
A guard providing access to a mutex’s protected data.

Functions§

nstd_mutex_drop
Frees an instance of NSTDMutex after invoking callback with the mutex’s data.
nstd_mutex_free
Frees an instance of NSTDMutex.
nstd_mutex_get
Returns a pointer to a mutex’s raw data.
nstd_mutex_get_mut
Returns a mutable pointer to a mutex’s raw data.
nstd_mutex_into_inner
Consumes a mutex and returns the data it was protecting.
nstd_mutex_is_poisoned
Determines whether or not a mutex’s data is poisoned.
nstd_mutex_lock
Waits for a mutex lock to become acquired, returning a guard wrapping the protected data.
nstd_mutex_new
Creates a new mutual exclusion primitive.
nstd_mutex_try_lock
The non-blocking variant of nstd_mutex_lock returning an uninitialized “none” result if the mutex is locked by another thread.
nstd_mutex_unlock
Unlocks a mutex by consuming a mutex guard.

Type Aliases§

NSTDMutexLockResult
A lock result returned from nstd_mutex_lock containing the mutex guard whether or not the data is poisoned.
NSTDOptionalMutex
Represents an optional value of type NSTDMutex.
NSTDOptionalMutexLockResult
An optional value of type NSTDMutexLockResult.