Wiki Page Content

Differences between revisions 6 and 7
Revision 6 as of 2010-10-18 01:17:26
Size: 1770
Editor: SheenaSmith
Comment: update content - pointers, structs
Revision 7 as of 2011-02-25 21:00:37
Size: 1477
Editor: Paul Walters
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.

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.


CategoryAPI, CategoryMutex

None: SDL_CondWait (last edited 2015-04-26 19:04:51 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit