AWS IoT Device SDK C: Platform
Platform portability layer
Return to main page ↑
IotSemaphore_TimedWait

Attempt to wait on (lock) a semaphore with a timeout.

uint32_t timeoutMs );

This function blocks and waits until a counting semaphore is positive or its timeout expires (whichever is sooner). It decrements pSemaphore and returns true if the semaphore is positive at some time during the wait. If pSemaphore is always 0 during the wait, this function returns false.

Parameters
[in]pSemaphoreThe semaphore to lock.
[in]timeoutMsRelative timeout of semaphore lock. This function returns false if the semaphore couldn't be locked within this timeout.
Returns
true if the semaphore wait succeeded; false if it timed out.
See also
IotSemaphore_TryWait for a nonblocking wait; IotSemaphore_Wait for a blocking wait.