Function nstd_sys::mutex::nstd_mutex_lock
source · #[no_mangle]
pub extern "C" fn nstd_mutex_lock<'m, 'a>(
mutex: &'m NSTDMutex<'a>
) -> NSTDMutexLockResult<'m, 'a>Available on crate feature
nstd_mutex only.Expand description
Waits for a mutex lock to become acquired, returning a guard wrapping the protected data.
Attempting to call this function on a thread that already owns the lock will either result in a panic or a deadlock.
Parameters:
const NSTDMutex *mutex- The mutex to lock.
Returns
NSTDMutexLockResult guard - A handle to the mutex’s protected data.
Panics
This operation may panic if the lock is already held by the current thread.