|
Size: 1019
Comment: minor change
|
Size: 1142
Comment: minor change
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 41: | Line 41: |
| * | *<<BR>><<Color2(green,Should this example be Included on the SDL_!DestroyMutex page? What about SDL_mutexP or SDL_mutexV?)>> |
DRAFT |
SDL_CreateMutex
Use this function to create a mutex, initialized unlocked *...create a new, unlocked mutex* create and initialize an unlocked mutex.
Syntax
SDL_mutex* SDL_CreateMutex(void)
Return Value
A pointer to an SDL_mutex structure to be initialized in an unlocked state.
Code Examples
*
SDL_mutex *mut;
mut=SDL_CreateMutex();
.
.
if(SDL_mutexP(mut)==-1){
fprintf(stderr, "Couldn't lock mutex\n");
exit(-1);
}
.
/* Do stuff while mutex is locked */
.
.
if(SDL_mutexV(mut)==-1){
fprintf(stderr, "Couldn't unlock mutex\n");
exit(-1);
}
SDL_DestroyMutex(mut);
*
green
Remarks
You can add useful comments here
