SDL
2.0
|
#include "../SDL_internal.h"
#include "SDL_timer.h"
#include "SDL_timer_c.h"
#include "SDL_atomic.h"
#include "SDL_cpuinfo.h"
#include "../thread/SDL_systhread.h"
Go to the source code of this file.
Data Structures | |
struct | SDL_Timer |
struct | SDL_TimerMap |
struct | SDL_TimerData |
Functions | |
static void | SDL_AddTimerInternal (SDL_TimerData *data, SDL_Timer *timer) |
static int | SDL_TimerThread (void *_data) |
int | SDL_TimerInit (void) |
void | SDL_TimerQuit (void) |
SDL_TimerID | SDL_AddTimer (Uint32 interval, SDL_TimerCallback callback, void *param) |
Add a new timer to the pool of timers already running. More... | |
SDL_bool | SDL_RemoveTimer (SDL_TimerID id) |
Remove a timer knowing its ID. More... | |
Variables | |
static SDL_TimerData | SDL_timer_data |
SDL_TimerID SDL_AddTimer | ( | Uint32 | interval, |
SDL_TimerCallback | callback, | ||
void * | param | ||
) |
Add a new timer to the pool of timers already running.
Definition at line 279 of file SDL_timer.c.
References SDL_TimerData::active, SDL_Timer::callback, callback(), SDL_Timer::canceled, SDL_TimerData::freelist, SDL_Timer::interval, SDL_TimerData::lock, SDL_Timer::next, SDL_TimerMap::next, SDL_TimerData::nextID, SDL_Timer::param, SDL_TimerData::pending, SDL_Timer::scheduled, SDL_AtomicGet, SDL_AtomicIncRef, SDL_AtomicLock, SDL_AtomicSet, SDL_AtomicUnlock, SDL_free, SDL_GetTicks(), SDL_LockMutex, SDL_malloc, SDL_OutOfMemory, SDL_RemoveTimer(), SDL_SemPost, SDL_timer_data, SDL_TimerInit(), SDL_UnlockMutex, SDL_TimerData::sem, SDL_TimerMap::timer, SDL_Timer::timerID, SDL_TimerMap::timerID, SDL_TimerData::timermap, and SDL_TimerData::timermap_lock.
|
static |
Definition at line 80 of file SDL_timer.c.
References SDL_Timer::next, NULL, SDL_Timer::scheduled, SDLCALL, and SDL_TimerData::timers.
Referenced by SDL_TimerThread().
SDL_bool SDL_RemoveTimer | ( | SDL_TimerID | id | ) |
Remove a timer knowing its ID.
Definition at line 342 of file SDL_timer.c.
References SDL_Timer::canceled, SDL_TimerMap::next, NULL, SDL_AtomicGet, SDL_AtomicSet, SDL_FALSE, SDL_free, SDL_LockMutex, SDL_timer_data, SDL_TRUE, SDL_UnlockMutex, SDL_TimerMap::timer, SDL_TimerMap::timerID, SDL_TimerData::timermap, and SDL_TimerData::timermap_lock.
Referenced by SDL_AddTimer().
int SDL_TimerInit | ( | void | ) |
Definition at line 207 of file SDL_timer.c.
References SDL_TimerData::active, SDL_TimerData::nextID, SDL_AtomicGet, SDL_AtomicSet, SDL_CreateMutex, SDL_CreateSemaphore, SDL_CreateThreadInternal(), SDL_DestroyMutex, SDL_timer_data, SDL_TimerQuit(), SDL_TimerThread(), SDL_TimerData::sem, SDL_TimerData::thread, and SDL_TimerData::timermap_lock.
Referenced by SDL_AddTimer(), and SDL_InitSubSystem().
Definition at line 239 of file SDL_timer.c.
References SDL_TimerData::active, SDL_TimerData::freelist, SDL_Timer::next, SDL_TimerMap::next, NULL, SDL_AtomicCAS, SDL_DestroyMutex, SDL_DestroySemaphore, SDL_free, SDL_SemPost, SDL_timer_data, SDL_WaitThread, SDL_TimerData::sem, SDL_TimerData::thread, SDL_TimerData::timermap, SDL_TimerData::timermap_lock, and SDL_TimerData::timers.
Referenced by SDL_QuitSubSystem(), and SDL_TimerInit().
|
static |
Definition at line 101 of file SDL_timer.c.
References SDL_TimerData::active, SDL_Timer::callback, SDL_Timer::canceled, SDL_TimerData::freelist, SDL_Timer::interval, SDL_TimerData::lock, SDL_Timer::next, NULL, SDL_Timer::param, SDL_TimerData::pending, SDL_Timer::scheduled, SDL_AddTimerInternal(), SDL_AtomicGet, SDL_AtomicLock, SDL_AtomicSet, SDL_AtomicUnlock, SDL_GetTicks(), SDL_MUTEX_MAXWAIT, SDL_SemWaitTimeout, SDL_TimerData::sem, and SDL_TimerData::timers.
Referenced by SDL_TimerInit().
|
static |
Definition at line 71 of file SDL_timer.c.
Referenced by SDL_AddTimer(), SDL_RemoveTimer(), SDL_TimerInit(), and SDL_TimerQuit().