Infineon Logo AIROC BTSDK v4.7 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Mutexes

Mutex management functionss. More...

Functions

wiced_mutex_t * wiced_rtos_create_mutex (void)
 Creates a new instance of mutex. More...
 
wiced_result_t wiced_rtos_init_mutex (wiced_mutex_t *mutex)
 Initialises a mutex. More...
 
wiced_result_t wiced_rtos_lock_mutex (wiced_mutex_t *mutex)
 Obtains the lock on a mutex. More...
 
wiced_result_t wiced_rtos_unlock_mutex (wiced_mutex_t *mutex)
 Releases the lock on a mutex. More...
 

Detailed Description

Mutex management functionss.

Function Documentation

wiced_mutex_t* wiced_rtos_create_mutex ( void  )

Creates a new instance of mutex.

Creates a new mutex (Allocates memory for a new mutex instance and returns the pointer)

Returns
valid pointer : on success.
NULL : if an error occurred
wiced_result_t wiced_rtos_init_mutex ( wiced_mutex_t *  mutex)

Initialises a mutex.

Initialises a mutex A mutex is different to 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
mutex: a pointer to the mutex handle to be initialised
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred
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 thead, the calling thread will be suspended until the mutex lock is released by the other thread.

Parameters
mutex: a pointer to the mutex handle to be locked
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred
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
mutex: a pointer to the mutex handle to be unlocked
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred