DRAFT |
SDL_CondWait
Use this function to coordinate threads in a multi-threaded environment. This function will unlock the provided mutex and wait for the condition variable to be signaled. Once the condition variable is signaled this function will re-lock the mutex and return.
Contents
Syntax
int SDL_CondWait(SDL_cond* cond,
SDL_mutex* mutex)
Function Parameters
cond |
the condition pointer whose signal will be waited on. |
mutex |
mutex pointer used to gate thread access. |
Return Value
Returns 0 when it is signaled or a negative error code on failure; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
This function unlocks the specified mutex and waits on another thread to call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable cond. The mutex is re-locked once the condition variable is signaled.
The mutex must be locked before entering this function.
This function is the equivalent of calling SDL_CondWaitTimeout with a time length of SDL_MUTEX_MAXWAIT.
