zenilib
0.5.3.0
|
#include "SDL_config.h"
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <sys/time.h>
#include "SDL_thread.h"
#include "SDL_timer.h"
Go to the source code of this file.
Functions | |
SDL_sem * | SDL_CreateSemaphore (Uint32 initial_value) |
void | SDL_DestroySemaphore (SDL_sem *sem) |
int | SDL_SemPost (SDL_sem *sem) |
int | SDL_SemTryWait (SDL_sem *sem) |
Uint32 | SDL_SemValue (SDL_sem *sem) |
int | SDL_SemWait (SDL_sem *sem) |
int | SDL_SemWaitTimeout (SDL_sem *sem, Uint32 timeout) |
Create a semaphore, initialized with value, returns NULL on failure.
Definition at line 45 of file SDL_syssem.c.
References NULL, SDL_free(), SDL_malloc(), SDL_OutOfMemory, and SDL_SetError().
Referenced by PSP_EventInit(), SDL_CreateCond(), SDL_CreateMutex(), SDL_CreateThread(), SDL_SYS_JoystickInit(), and SDL_TimerInit().
Destroy a semaphore.
Definition at line 61 of file SDL_syssem.c.
References SDL_free().
Referenced by PSP_EventQuit(), SDL_CreateSemaphore(), SDL_CreateThread(), SDL_DestroyCond(), SDL_DestroyMutex(), SDL_SYS_JoystickQuit(), and SDL_TimerQuit().
Atomically increases the semaphore's count (not blocking).
Definition at line 183 of file SDL_syssem.c.
References SDL_SetError().
Referenced by EventUpdate(), JoystickUpdate(), PSP_PumpEvents(), SDL_AddTimer(), SDL_CondBroadcast(), SDL_CondSignal(), SDL_CondWaitTimeout(), SDL_mutexV(), SDL_RunThread(), SDL_SYS_JoystickUpdate(), and SDL_TimerQuit().
Non-blocking variant of SDL_SemWait().
Definition at line 70 of file SDL_syssem.c.
References SDL_MUTEX_TIMEDOUT, and SDL_SetError().
Referenced by SDL_SemWaitTimeout().
Returns the current count of the semaphore.
Definition at line 170 of file SDL_syssem.c.
References ret.
This function suspends the calling thread until the semaphore pointed to by sem
has a positive count. It then atomically decreases the semaphore count.
Definition at line 85 of file SDL_syssem.c.
References SDL_SetError().
Referenced by EventUpdate(), JoystickUpdate(), PSP_PumpEvents(), SDL_CondBroadcast(), SDL_CondSignal(), SDL_CondWaitTimeout(), SDL_CreateThread(), SDL_LockMutex(), SDL_mutexP(), SDL_SemWaitTimeout(), SDL_SYS_JoystickUpdate(), and SDL_TryLockMutex().
Variant of SDL_SemWait() with a timeout in milliseconds.
Definition at line 101 of file SDL_syssem.c.
References NULL, SDL_Delay(), SDL_GetTicks(), SDL_MUTEX_MAXWAIT, SDL_MUTEX_TIMEDOUT, SDL_SemTryWait(), SDL_SemWait(), and SDL_SetError().
Referenced by SDL_CondWaitTimeout(), SDL_SemTryWait(), SDL_SemWait(), and SDL_TimerThread().