5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches
Mutexes

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)
 

Detailed Description

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.

Function Documentation

◆ wiced_rtos_deinit_mutex()

wiced_result_t wiced_rtos_deinit_mutex ( wiced_mutex_t * mutex)

De-initialize a mutex

Deletes a mutex created with wiced_rtos_init_mutex

Parameters
[in]mutex: A pointer to the mutex handle
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred

◆ wiced_rtos_init_mutex()

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.

Parameters
[in]mutex: A pointer to the mutex handle to be initialized
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred

◆ wiced_rtos_lock_mutex()

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.

Parameters
[in]mutex: A pointer to the mutex handle to be locked
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred

◆ wiced_rtos_unlock_mutex()

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.

Parameters
[in]mutex: A pointer to the mutex handle to be unlocked
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred