|
⇤ ← Revision 1 as of 2013-08-08 23:26:33
Size: 757
Comment:
|
Size: 781
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 29: | Line 29: |
| .[[SDL_TryLockMutex]] |
SDL_UnlockMutex
Use this function to unlock a mutex created with SDL_CreateMutex().
Contents
Syntax
int SDL_UnlockMutex(SDL_mutex* mutex)
Function Parameters
mutex |
the mutex to unlock |
Return Value
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
Code Examples
SDL_mutex *mutex;
mutex = SDL_CreateMutex();
if (!mutex) {
fprintf(stderr, "Couldn't create mutex\n");
return;
}
if (SDL_LockMutex(mutex) == 0) {
/* Do stuff while mutex is locked */
SDL_UnlockMutex(mutex);
} else {
fprintf(stderr, "Couldn't lock mutex\n");
}
SDL_DestroyMutex(mutex);
Remarks
You can add useful comments here
