4 #include <SDL_thread.h>
11 void Thread_Shutdown(void)
15 qboolean Thread_HasThreads(void)
20 void *_Thread_CreateMutex(const char *filename, int fileline)
22 void *mutex = SDL_CreateMutex();
24 Sys_PrintfToTerminal("%p create %s:%i\n" , mutex, filename, fileline);
29 void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline)
32 Sys_PrintfToTerminal("%p destroy %s:%i\n", mutex, filename, fileline);
34 SDL_DestroyMutex((SDL_mutex *)mutex);
37 int _Thread_LockMutex(void *mutex, const char *filename, int fileline)
40 Sys_PrintfToTerminal("%p lock %s:%i\n" , mutex, filename, fileline);
42 return SDL_LockMutex((SDL_mutex *)mutex);
45 int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline)
48 Sys_PrintfToTerminal("%p unlock %s:%i\n" , mutex, filename, fileline);
50 return SDL_UnlockMutex((SDL_mutex *)mutex);
53 void *Thread_CreateCond(void)
55 return SDL_CreateCond();
58 void Thread_DestroyCond(void *cond)
60 SDL_DestroyCond((SDL_cond *)cond);
63 int Thread_CondSignal(void *cond)
65 return SDL_CondSignal((SDL_cond *)cond);
68 int Thread_CondBroadcast(void *cond)
70 return SDL_CondBroadcast((SDL_cond *)cond);
73 int Thread_CondWait(void *cond, void *mutex)
75 return SDL_CondWait((SDL_cond *)cond, (SDL_mutex *)mutex);
78 void *Thread_CreateThread(int (*fn)(void *), void *data)
80 return SDL_CreateThread(fn, data);
83 int Thread_WaitThread(void *thread, int retval)
86 SDL_WaitThread((SDL_Thread *)thread, &status);