zephyr::raw

Function k_mutex_unlock

source
pub unsafe extern "C" fn k_mutex_unlock(mutex: *mut k_mutex) -> i32
Expand description

@brief Unlock a mutex.

This routine unlocks @a mutex. The mutex must already be locked by the calling thread.

The mutex cannot be claimed by another thread until it has been unlocked by the calling thread as many times as it was previously locked by that thread.

Mutexes may not be unlocked in ISRs, as mutexes must only be manipulated in thread context due to ownership and priority inheritance semantics.

@param mutex Address of the mutex.

@retval 0 Mutex unlocked. @retval -EPERM The current thread does not own the mutex @retval -EINVAL The mutex is not locked