|
⇤ ← Revision 1 as of 2010-06-07 00:09:01
Size: 1337
Comment: create page, add content (Wed Mar 10 ver; changeset 4428)
|
Size: 1920
Comment: update content (old wiki)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
| Use this function to ^wait on a condition variable for a fixed delay^. | Use this function to ^wait on a condition variable for a fixed delay^ ''-or-'' *with timeout*. |
| Line 8: | Line 8: |
| <<Color2(green,The description in the header is too long and too detailed. Tried to put in a simple summary. Should it be the longer description?)>> | <<Color2(green,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?<<BR>>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))>> |
| Line 20: | Line 20: |
| ||'''cond'''||^a pointer to the SDL_cond structure that is being applied^ ???|| ||'''mutex'''||^a pointer to the SDL_mutex structure to be timed out^ ???|| |
||'''cond'''||^a pointer to the condition variable that is being applied^ ???|| ||'''mutex'''||^a pointer to the mutex to be timed out^ ???|| |
| Line 25: | Line 25: |
| 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; call [[SDL_GetError]]() for more information. | 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,, ^a negative error code on failure^; call [[SDL_GetError]]() for more information. |
| Line 33: | Line 33: |
| /!\ {i} On some platforms this function is implemented by looping with a delay of 1 ms, and so should be avoided if possible. | *<<BR>>'''mutex''' is unlocked so it must be locked when the function is called and it will ,,re-,, ^un^lock afterward. <<Color2(green,Is this a typo in the old wiki - ''re'' vs ''un''lock? Does the function handle the locking/unlocking or does the programmer need to do that?)>><<BR>>* On some platforms this function is implemented by looping with a delay of 1 ms, and so should be avoided if possible. |
| Line 36: | Line 40: |
| .[[SDL_CondWait]] ??? | .[[SDL_CondWait]] * |
DRAFT |
SDL_CondWaitTimeout
Use this function to wait on a condition variable for a fixed delay -or- *with timeout*.
green
Contents
Syntax
int SDL_CondWaitTimeout(SDL_cond* cond,
SDL_mutex* mutex,
Uint32 ms)
Function Parameters
cond |
a pointer to the condition variable that is being applied ??? |
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, and -1 on error 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.
green
*
On some platforms this function is implemented by looping with a delay of 1 ms, and so should be avoided if possible.
