DRAFT

SDL_CondWaitTimeout

Use this function to wait on a condition variable for a fixed delay -or- *with timeout*.

The description in the header is too long and too detailed. Tried to write a simple summary. Should it be the longer description here instead?
Waits for at most ms milliseconds and returns 0 if the condition variable is signaled SDL_MUTEX_TIMEDOUT if the condition is not signaled in the allotted time and -1 on error. (with appropriate commas that don't work in green)

Syntax

int SDL_CondWaitTimeout(SDL_cond*  cond,
                        SDL_mutex* mutex,
                        Uint32     ms)

Function Parameters

cond

the applicable condition variable ???

mutex

a pointer to the mutex to be timed out ???

ms

the maximum number of milliseconds to wait

Return Value

Returns 0 if the condition variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not signaled in the allotted time, or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

*
mutex is unlocked so it must be locked when the function is called and it will re- unlock afterward.

Is this a typo in the old wiki - re vs unlock? Does the function handle the locking/unlocking or does the programmer need to do that?
*

On some platforms this function is implemented by looping with a delay of 1 ms, and so should be avoided if possible.


CategoryAPI, CategoryMutex

SDL_CondWaitTimeout (last edited 2010-10-18 01:16:39 by SheenaSmith)

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