APIs for acquiring and working with Mutexes.
cy_rslt_t | cy_rtos_mutex_init (cy_mutex_t *mutex, bool recursive) |
Create a mutex which can support recursion or not. More... | |
cy_rslt_t | cy_rtos_mutex_get (cy_mutex_t *mutex, cy_time_t timeout_ms) |
Get a mutex. More... | |
cy_rslt_t | cy_rtos_mutex_set (cy_mutex_t *mutex) |
Set a mutex. More... | |
cy_rslt_t | cy_rtos_mutex_deinit (cy_mutex_t *mutex) |
Deletes a mutex. More... | |
#define | cy_rtos_init_mutex2(mutex, recursive) cy_rtos_mutex_init(mutex, recursive) |
Create a mutex which can support recursion or not. More... | |
#define | cy_rtos_init_mutex(mutex) cy_rtos_mutex_init(mutex, true) |
Create a mutex which can support recursion. More... | |
#define | cy_rtos_get_mutex(mutex, timeout_ms) cy_rtos_mutex_get(mutex, timeout_ms) |
Get a mutex. More... | |
#define | cy_rtos_set_mutex(mutex) cy_rtos_mutex_set(mutex) |
Set a mutex. More... | |
#define | cy_rtos_deinit_mutex(mutex) cy_rtos_mutex_deinit(mutex) |
Deletes a mutex. More... | |
#define cy_rtos_init_mutex2 | ( | mutex, | |
recursive | |||
) | cy_rtos_mutex_init(mutex, recursive) |
Create a mutex which can support recursion or not.
Creates a binary mutex which can be used for mutual exclusion to prevent simulatenous access of shared resources. Created mutexes can support priority inheritance if recursive.
[out] | mutex | Pointer to the mutex handle to be initialized |
[in] | recursive | Should the created mutex support recursion or not |
#define cy_rtos_init_mutex | ( | mutex | ) | cy_rtos_mutex_init(mutex, true) |
Create a mutex which can support recursion.
Creates a binary mutex which can be used for mutual exclusion to prevent simulatenous access of shared resources. Created mutexes can support priority inheritance if recursive.
[out] | mutex | Pointer to the mutex handle to be initialized |
#define cy_rtos_get_mutex | ( | mutex, | |
timeout_ms | |||
) | cy_rtos_mutex_get(mutex, timeout_ms) |
Get a mutex.
If the mutex is available, it is acquired and this function returned. If the mutex is not available, the thread waits until the mutex is available or until the timeout occurs.
[in] | mutex | Pointer to the mutex handle |
[in] | timeout_ms | Maximum number of milliseconds to wait while attempting to get the mutex. Use the CY_RTOS_NEVER_TIMEOUT constant to wait forever. |
#define cy_rtos_set_mutex | ( | mutex | ) | cy_rtos_mutex_set(mutex) |
Set a mutex.
The mutex is released allowing any other threads waiting on the mutex to obtain the semaphore.
[in] | mutex | Pointer to the mutex handle |
#define cy_rtos_deinit_mutex | ( | mutex | ) | cy_rtos_mutex_deinit(mutex) |
Deletes a mutex.
This function frees the resources associated with a sempahore.
[in] | mutex | Pointer to the mutex handle |
cy_rslt_t cy_rtos_mutex_init | ( | cy_mutex_t * | mutex, |
bool | recursive | ||
) |
Create a mutex which can support recursion or not.
Creates a binary mutex which can be used for mutual exclusion to prevent simulatenous access of shared resources. Created mutexes can support priority inheritance if recursive.
[out] | mutex | Pointer to the mutex handle to be initialized |
[in] | recursive | Should the created mutex support recursion or not |
cy_rslt_t cy_rtos_mutex_get | ( | cy_mutex_t * | mutex, |
cy_time_t | timeout_ms | ||
) |
Get a mutex.
If the mutex is available, it is acquired and this function returned. If the mutex is not available, the thread waits until the mutex is available or until the timeout occurs.
[in] | mutex | Pointer to the mutex handle |
[in] | timeout_ms | Maximum number of milliseconds to wait while attempting to get the mutex. Use the CY_RTOS_NEVER_TIMEOUT constant to wait forever. |
cy_rslt_t cy_rtos_mutex_set | ( | cy_mutex_t * | mutex | ) |
Set a mutex.
The mutex is released allowing any other threads waiting on the mutex to obtain the semaphore.
[in] | mutex | Pointer to the mutex handle |
cy_rslt_t cy_rtos_mutex_deinit | ( | cy_mutex_t * | mutex | ) |
Deletes a mutex.
This function frees the resources associated with a sempahore.
[in] | mutex | Pointer to the mutex handle |