1.4.4.9 OSAL_MUTEX_Create Function
1.4.4.9 C
OSAL_RESULT OSAL_MUTEX_Create(OSAL_MUTEX_HANDLE_TYPE* mutexID)
1.4.4.9 Summary
Creates a mutex.
1.4.4.9 Description
This function creates a mutex, allocating storage if required and placing the mutex handle into the passed parameter.
1.4.4.9 Precondition
Mutex must have been declared.
1.4.4.9 Parameters
| Parameters | Description |
|---|---|
| mutexID | Pointer to the mutex handle |
1.4.4.9 Returns
OSAL_RESULT_TRUE - Mutex successfully created.
OSAL_RESULT_FALSE - Mutex failed to be created.
1.4.4.9 Example
OSAL_MUTEX_HANDLE_TYPE mutexData;
OSAL_MUTEX_Create(&mutexData);
...
if (OSAL_MUTEX_Lock(&mutexData, 1000) == OSAL_RESULT_TRUE)
{
// manipulate the shared data
...
}
1.4.4.9 Remarks
None.
