Description
Create and initialize a mutex. A mutex is used to gain exclusive access to a resource.
Files
os.h/os_mutex.c
Prototype
Arguments
p_mutex
is a pointer to a mutex control block that must be allocated in the application. The user will need to declare a “global” variable as follows, and pass a pointer to this variable to OSMutexCreate()
:
...
If OS_SAFETY_CRITICAL_IEC61508
is defined: you called this after calling OSSafetyCriticalStart()
and thus you are no longer allowed to create additional kernel objects.
Returned Value
None
Required Configuration
OS_CFG_MUTEX_EN
must be enabled in os_cfg.h. Refer to uC-OS-III Configuration Manual
Callers
Application.
Notes/Warnings
- Mutexes must be created before they are used.