#include <rtl.h>
OS_RESULT os_mut_release (
OS_IDmutex ); /* The mutex to release */
Description
The os_mut_release function decrements the internal counter
of the mutex identified by the function argument in order to
release the mutex. Only when the internal counter of the mutex is
zero, then the mutex is really free to be acquired by another
task.
The mutex object knows the task that currently owns it. Hence the
owning task can acquire and lock the mutex as many times as needed
using the os_mut_wait function. When a task that owns a mutex
tries to acquire it again, the task does not get blocked, but the
mutex's internal counter is incremented. The task that acquired the
mutex must release the mutex as many times as it was acquired, so
that the internal counter of the mutex is decremented to 0.
This function also restores the original task's priority if
priority inheritance has been applied to the owning task of
the mutex and his priority has been temporary raised.
The os_mut_release function is in the RL-RTX library. The
prototype is defined in rtl.h.
Note
Initialize the mutex object with os_mut_init before
performing any operation on it.
Return Value
The os_mut_release function returns the completion
value:
Return Value
Description
OS_R_OK
The mutex was successfully released
OS_R_NOK
An error occurred. This can be either because the internal
counter of the mutex is 0 or because the calling task is not the
owner of the mutex.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.