|
Size: 1477
Comment: re-worded for clarity and consistency with SDL_CondWaitTimeout
|
Size: 1515
Comment: Updated descriptions of function parameters
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 17: | Line 17: |
| ||'''cond''' ||^the applicable condition variable^ ??? || ||'''mutex''' ||^the mutex to unlock^ || |
||'''cond''' ||^The condition pointer whose signal will be waited on.^ || ||'''mutex''' ||^Mutex pointer used to gate thread access.^ || |
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.
