Go to the documentation of this file.
31 #ifndef IOT_THREADS_H_
32 #define IOT_THREADS_H_
35 #include "iot_config.h"
289 uint32_t initialValue,
380 uint32_t timeoutMs );
void IotSemaphore_Destroy(IotSemaphore_t *pSemaphore)
Free resources used by a semaphore.
void IotMutex_Lock(IotMutex_t *pMutex)
Lock a mutex. This function should only return when the mutex is locked; it is not expected to fail.
void IotMutex_Unlock(IotMutex_t *pMutex)
Unlock a mutex. This function should only return when the mutex is unlocked; it is not expected to fa...
bool IotMutex_Create(IotMutex_t *pNewMutex, bool recursive)
Create a new mutex.
void IotSemaphore_Post(IotSemaphore_t *pSemaphore)
Post to (unlock) a semaphore. This function should only return when the semaphore post succeeds; it i...
uint32_t IotSemaphore_GetCount(IotSemaphore_t *pSemaphore)
Query the current count of the semaphore.
bool IotMutex_TryLock(IotMutex_t *pMutex)
Attempt to lock a mutex. Return immediately if the mutex is not available.
bool Iot_CreateDetachedThread(IotThreadRoutine_t threadRoutine, void *pArgument, int32_t priority, size_t stackSize)
Create a new detached thread, i.e. a thread that cleans up after itself.
void IotMutex_Destroy(IotMutex_t *pMutex)
Free resources used by a mutex.
bool IotSemaphore_Create(IotSemaphore_t *pNewSemaphore, uint32_t initialValue, uint32_t maxValue)
Create a new counting semaphore.
bool IotSemaphore_TryWait(IotSemaphore_t *pSemaphore)
Attempt to wait on (lock) a semaphore. Return immediately if the semaphore is not available.
bool IotSemaphore_TimedWait(IotSemaphore_t *pSemaphore, uint32_t timeoutMs)
Attempt to wait on (lock) a semaphore with a timeout.
void IotSemaphore_Wait(IotSemaphore_t *pSemaphore)
Wait on (lock) a semaphore. This function should only return when the semaphore wait succeeds; it is ...