Module mutex

Source
Available on crate features os and os_unix_mutex only.
Expand description

A mutual exclusion primitive useful for protecting shared data.

Structs§

NSTDUnixMutex
A mutual exclusion primitive useful for protecting shared data.
NSTDUnixMutexGuard
A handle to a mutex’s protected data.

Functions§

nstd_os_unix_mutex_drop
Frees an instance of NSTDUnixMutex after invoking callback 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 of duration.
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§

NSTDUnixMutexLockResult
A result type returned from nstd_os_unix_mutex_lock containing the mutex guard whether or not the data is poisoned.
NSTDUnixOptionalMutex
Represents an optional value of type NSTDUnixMutex.
NSTDUnixOptionalMutexLockResult
An optional value of type NSTDUnixMutexLockResult.