SDL_mutexP -- Lock a mutex
#include "SDL.h" #include "SDL_thread.h" int SDL_mutexP(SDL_mutex *mutex);
Locks the mutex, which was previously created with SDL_CreateMutex. If the mutex is already locked by another thread then SDL_mutexP will not return until the thread that locked it unlocks it (with SDL_mutexV). If called repeatedly on a mutex, SDL_mutexV must be called equal amount of times to return the mutex to unlocked state.
SDL also defines a macro #define SDL_LockMutex(m) SDL_mutexP(m).
- On error
- On success