|
Size: 1770
Comment: update content - pointers, structs
|
Size: 1477
Comment: re-worded for clarity and consistency with SDL_CondWaitTimeout
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| ||<tablewidth="100%" style="color: #FF0000;" :> DRAFT|| | ||<tablewidth="100%"style="color: rgb(255, 0, 0); text-align: center;">DRAFT || |
| Line 6: | Line 7: |
| Use this function to wait on the condition variable, unlocking the provided mutex. <<Color2(green, Alternate: ...unlock the provided mutex and wait on the condition variable.)>> <<Color2(green,I expect that this works on the current thread or the one that it is called from within. Is that correct? Is there any need to specify any of this here?)>> |
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. |
| Line 17: | Line 16: |
| == Function Parameters == ||'''cond''' ||^the applicable condition variable^ ??? || ||'''mutex''' ||^the mutex to unlock^ || |
|
| Line 18: | Line 20: |
| == Function Parameters == ||'''cond'''||^the applicable condition variable^ ???|| ||'''mutex'''||^the mutex to unlock^|| |
|
| Line 29: | Line 28: |
| == 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. |
|
| Line 30: | Line 31: |
| == Remarks == The mutex must be locked before entering this function! The mutex is re-locked once the condition variable is signaled *^by^ another thread call^ing^ [[SDL_CondSignal]]() or [[SDL_CondBroadcast]]() on the condition variable '''cond'''.* |
The mutex must be locked before entering this function. |
| Line 33: | Line 33: |
| <<Color2(green,Alternate version:)>> The mutex must be locked before entering this function! <<Color2(green,This line may be moved to the end instead.)>> 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. |
This function is the equivalent of calling [[SDL_CondWaitTimeout]] with a time length of SDL_MUTEX_MAXWAIT. |
| Line 39: | Line 36: |
| .[[SDL_CondSignal]] * .[[SDL_CondWaitTimeout]] * .[[SDL_mutexP]] * |
. [[SDL_CondSignal]] * . [[SDL_CondWaitTimeout]] * . [[SDL_mutexP]] * |
| Line 44: | Line 41: |
| [[CategoryAPI]], [[CategoryMutex]] | [[CategoryAPI]], CategoryMutex |
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 applicable condition variable ??? |
mutex |
the mutex to unlock |
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.
