SDL_mutexP

Name

SDL_mutexP -- Lock a mutex

Synopsis

#include "SDL.h"
#include "SDL_thread.h"

int SDL_mutexP(SDL_mutex *mutex);

Description

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).

Return value

-1

0

See Also

SDL_CreateMutex, SDL_mutexV

SDL_mutexP (last edited 2009-09-03 19:10:22 by 213-216-235-59-Tuira-TR1)