zenilib: zenilib/jni/external/sdl/src/timer/SDL_timer.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Typedefs | Functions | Variables
SDL_timer.c File Reference
`#include "SDL_config.h"`
`#include "SDL_timer.h"`
`#include "SDL_timer_c.h"`
`#include "SDL_atomic.h"`
`#include "SDL_cpuinfo.h"`
`#include "SDL_thread.h"`

Go to the source code of this file.

## Typedefs

typedef struct _SDL_Timer | SDL_Timer
typedef struct _SDL_TimerMap | SDL_TimerMap

## Functions

SDL_TimerID | SDL_AddTimer (Uint32 interval, SDL_TimerCallback callback, void *param)
| Add a new timer to the pool of timers already running. More...
static void | SDL_AddTimerInternal (SDL_TimerData *data, SDL_Timer *timer)
SDL_bool | SDL_RemoveTimer (SDL_TimerID id)
| Remove a timer knowing its ID. More...
int | SDL_TimerInit (void)
void | SDL_TimerQuit (void)
static int | SDL_TimerThread (void *_data)

## Variables

static SDL_TimerData | SDL_timer_data

## Typedef Documentation

typedef struct _SDL_Timer SDL_Timer

typedef struct _SDL_TimerMap SDL_TimerMap

## Function Documentation

SDL_TimerID SDL_AddTimer | ( | Uint32 | interval,
|  | SDL_TimerCallback | callback,
|  | void * | param
| ) |  |

Add a new timer to the pool of timers already running.

Returns
  A timer ID, or NULL when an error occurs.

Definition at line 284 of file SDL_timer.c.

References SDL_AtomicIncRef, SDL_AtomicLock(), SDL_AtomicUnlock(), SDL_FALSE, SDL_free(), SDL_GetTicks(), SDL_LockMutex(), SDL_malloc(), SDL_OutOfMemory, SDL_RemoveTimer(), SDL_SemPost(), SDL_timer_data, SDL_TimerInit(), and SDL_UnlockMutex().

Referenced by SDLTest_SetTestTimeout().

static void SDL_AddTimerInternal | ( | SDL_TimerData * | data,
|  | SDL_Timer * | timer
| ) |  |

static

Definition at line 80 of file SDL_timer.c.

References NULL.

Referenced by SDL_TimerThread().

SDL_bool SDL_RemoveTimer | ( | SDL_TimerID | id | ) |

Remove a timer knowing its ID.

Returns
  A boolean value indicating success or failure.

Warning
  It is not safe to remove a timer multiple times.

Definition at line 354 of file SDL_timer.c.

References NULL, SDL_FALSE, SDL_free(), SDL_LockMutex(), SDL_timer_data, SDL_TRUE, and SDL_UnlockMutex().

Referenced by SDL_AddTimer(), and SDLTest_RunTest().

int SDL_TimerInit | ( | void |  | ) |

Definition at line 206 of file SDL_timer.c.

References NULL, SDL_AtomicSet(), SDL_CreateMutex(), SDL_CreateSemaphore(), SDL_CreateThread(), SDL_DestroyMutex(), SDL_timer_data, SDL_TimerQuit(), SDL_TimerThread(), and SDL_TRUE.

Referenced by SDL_AddTimer(), and SDL_InitSubSystem().

void SDL_TimerQuit | ( | void |  | ) |

Definition at line 242 of file SDL_timer.c.

References NULL, SDL_DestroyMutex(), SDL_DestroySemaphore(), SDL_FALSE, SDL_free(), SDL_SemPost(), SDL_timer_data, and SDL_WaitThread().

Referenced by SDL_QuitSubSystem(), and SDL_TimerInit().

static int SDL_TimerThread | ( | void * | _data | ) |

static

Definition at line 101 of file SDL_timer.c.

References NULL, SDL_AddTimerInternal(), SDL_AtomicLock(), SDL_AtomicUnlock(), SDL_GetTicks(), SDL_MUTEX_MAXWAIT, SDL_SemWaitTimeout(), and SDL_TRUE.

Referenced by SDL_TimerInit().

## Variable Documentation

SDL_TimerData SDL_timer_data

static

Definition at line 71 of file SDL_timer.c.

Referenced by SDL_AddTimer(), SDL_RemoveTimer(), SDL_TimerInit(), and SDL_TimerQuit().