Functions | |
| wiced_result_t | wiced_rtos_deinit_mutex (wiced_mutex_t *mutex) |
| wiced_result_t | wiced_rtos_init_mutex (wiced_mutex_t *mutex) |
| wiced_result_t | wiced_rtos_lock_mutex (wiced_mutex_t *mutex) |
| wiced_result_t | wiced_rtos_unlock_mutex (wiced_mutex_t *mutex) |
Mutex management functions
For RTOS (ThreadX) The Mutex are recursive in nature. If the calling thread held a Mutex lock and re-acquires it, then the count(tx_mutex_ownership_count) is incremented. The thread has to release the Mutex lock by unlocking as many times as the count value.
| wiced_result_t wiced_rtos_deinit_mutex | ( | wiced_mutex_t * | mutex | ) |
De-initialize a mutex
Deletes a mutex created with wiced_rtos_init_mutex
| [in] | mutex | : A pointer to the mutex handle |
| wiced_result_t wiced_rtos_init_mutex | ( | wiced_mutex_t * | mutex | ) |
Initializes a mutex
A mutex is different from a semaphore in that a thread that already holds the lock on the mutex can request the lock again (nested) without causing it to be suspended.
| [in] | mutex | : A pointer to the mutex handle to be initialized |
| wiced_result_t wiced_rtos_lock_mutex | ( | wiced_mutex_t * | mutex | ) |
Obtains the lock on a mutex
Attempts to obtain the lock on a mutex. If the lock is already held by another thread, the calling thread will be suspended until the mutex lock is released by the other thread.
| [in] | mutex | : A pointer to the mutex handle to be locked |
| wiced_result_t wiced_rtos_unlock_mutex | ( | wiced_mutex_t * | mutex | ) |
Releases the lock on a mutex
Releases a currently held lock on a mutex. If another thread is waiting on the mutex lock, then it will be resumed.
| [in] | mutex | : A pointer to the mutex handle to be unlocked |