Platform API Reference
Platform portability layer
IotMutex_Create

Create a new mutex.

bool IotMutex_Create( IotMutex_t * pNewMutex,
bool recursive );

This function creates a new, unlocked mutex. It must be called on an uninitialized IotMutex_t. This function must not be called on an already-initialized IotMutex_t.

Parameters
[in]pNewMutexPointer to the memory that will hold the new mutex.
[in]recursiveSet to true to create a recursive mutex, i.e. a mutex that may be locked multiple times by the same thread. If the system does not support recursive mutexes, this function should do nothing and return false.
Returns
true if mutex creation succeeds; false otherwise.
See also
IotMutex_Destroy

Example

IotMutex_t mutex;
// Create non-recursive mutex.
if( IotMutex_Create( &mutex, false ) == true )
{
// Lock and unlock the mutex...
// Destroy the mutex when it's no longer needed.
IotMutex_Destroy( &mutex );
}
IotMutex_Create
bool IotMutex_Create(IotMutex_t *pNewMutex, bool recursive)
Create a new mutex.
IotMutex_t
_IotSystemMutex_t IotMutex_t
The type used to represent mutexes, configured with the type _IotSystemMutex_t.
Definition: iot_platform_types.h:75
IotMutex_Destroy
void IotMutex_Destroy(IotMutex_t *pMutex)
Free resources used by a mutex.