Wiki Page Content

Differences between revisions 9 and 10
Revision 9 as of 2011-03-18 22:22:50
Size: 1517
Editor: SheenaSmith
Comment: camelcase pragma change, fix category link
Revision 10 as of 2011-03-18 22:34:07
Size: 1517
Editor: SheenaSmith
Comment: minor formatting change
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
||'''cond''' ||^The condition pointer whose signal will be waited on.^ ||
||'''mutex''' ||^Mutex pointer used to gate thread access.^ ||
||'''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.

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.


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