MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_TimerQuit

Function SDL_TimerQuit

deps/SDL2/src/timer/SDL_timer.c:238–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238void
239SDL_TimerQuit(void)
240{
241 SDL_TimerData *data = &SDL_timer_data;
242 SDL_Timer *timer;
243 SDL_TimerMap *entry;
244
245 if (SDL_AtomicCAS(&data->active, 1, 0)) { /* active? Move to inactive. */
246 /* Shutdown the timer thread */
247 if (data->thread) {
248 SDL_SemPost(data->sem);
249 SDL_WaitThread(data->thread, NULL);
250 data->thread = NULL;
251 }
252
253 SDL_DestroySemaphore(data->sem);
254 data->sem = NULL;
255
256 /* Clean up the timer entries */
257 while (data->timers) {
258 timer = data->timers;
259 data->timers = timer->next;
260 SDL_free(timer);
261 }
262 while (data->freelist) {
263 timer = data->freelist;
264 data->freelist = timer->next;
265 SDL_free(timer);
266 }
267 while (data->timermap) {
268 entry = data->timermap;
269 data->timermap = entry->next;
270 SDL_free(entry);
271 }
272
273 SDL_DestroyMutex(data->timermap_lock);
274 data->timermap_lock = NULL;
275 }
276}
277
278SDL_TimerID
279SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param)

Callers 2

SDL_QuitSubSystemFunction · 0.85
SDL_TimerInitFunction · 0.85

Calls 6

SDL_AtomicCASFunction · 0.85
SDL_WaitThreadFunction · 0.85
SDL_freeFunction · 0.85
SDL_SemPostFunction · 0.50
SDL_DestroySemaphoreFunction · 0.50
SDL_DestroyMutexFunction · 0.50

Tested by

no test coverage detected