X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=thread_win.c;h=1cfad9a40031eabbd32d9412e45a4b5976de680d;hp=fa282f4d4f61dd13e48e2db20b1ce86c4e419237;hb=4c6cb7882855468365644ac65b6eb86a3e82a812;hpb=0a05c446ba26bd5897645a37ceec8646c5bc93eb diff --git a/thread_win.c b/thread_win.c index fa282f4d..1cfad9a4 100644 --- a/thread_win.c +++ b/thread_win.c @@ -27,7 +27,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) { void *mutex = (void *)CreateMutex(NULL, FALSE, NULL); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex create %s:%i\n" , mutex, filename, fileline); #endif return mutex; } @@ -35,7 +35,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline); + Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline); #endif CloseHandle(mutex); } @@ -43,7 +43,7 @@ void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) int _Thread_LockMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline); #endif return (WaitForSingleObject(mutex, INFINITE) == WAIT_FAILED) ? -1 : 0; } @@ -51,7 +51,7 @@ int _Thread_LockMutex(void *mutex, const char *filename, int fileline) int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline); #endif return (ReleaseMutex(mutex) == false) ? -1 : 0; } @@ -118,7 +118,7 @@ void *_Thread_CreateCond(const char *filename, int fileline) c->waiting = 0; c->signals = 0; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond create %s:%i\n" , c, filename, fileline); + Sys_Printf("%p cond create %s:%i\n" , c, filename, fileline); #endif return c; } @@ -127,7 +127,7 @@ void _Thread_DestroyCond(void *cond, const char *filename, int fileline) { thread_cond_t *c = (thread_cond_t *)cond; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline); #endif Thread_DestroySemaphore(c->sem); Thread_DestroySemaphore(c->done); @@ -139,7 +139,7 @@ int _Thread_CondSignal(void *cond, const char *filename, int fileline) thread_cond_t *c = (thread_cond_t *)cond; int n; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline); #endif WaitForSingleObject(c->mutex, INFINITE); n = c->waiting - c->signals; @@ -160,7 +160,7 @@ int _Thread_CondBroadcast(void *cond, const char *filename, int fileline) int i = 0; int n = 0; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline); #endif WaitForSingleObject(c->mutex, INFINITE); n = c->waiting - c->signals; @@ -181,7 +181,7 @@ int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline thread_cond_t *c = (thread_cond_t *)cond; int waitresult; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline); #endif WaitForSingleObject(c->mutex, INFINITE); @@ -228,7 +228,7 @@ void *_Thread_CreateThread(int (*fn)(void *), void *data, const char *filename, { threadwrapper_t *w = (threadwrapper_t *)calloc(sizeof(*w), 1); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread create %s:%i\n" , w, filename, fileline); + Sys_Printf("%p thread create %s:%i\n" , w, filename, fileline); #endif w->fn = fn; w->data = data; @@ -242,7 +242,7 @@ int _Thread_WaitThread(void *d, int retval, const char *filename, int fileline) { threadwrapper_t *w = (threadwrapper_t *)d; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread wait %s:%i\n" , w, filename, fileline); + Sys_Printf("%p thread wait %s:%i\n" , w, filename, fileline); #endif WaitForSingleObject(w->handle, INFINITE); CloseHandle(w->handle); @@ -264,7 +264,7 @@ void *_Thread_CreateBarrier(unsigned int count, const char *filename, int fileli { volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); + Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); #endif b->needed = count; b->called = 0; @@ -277,7 +277,7 @@ void _Thread_DestroyBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline); #endif Thread_DestroyMutex(b->mutex); Thread_DestroyCond(b->cond); @@ -287,7 +287,7 @@ void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline); #endif Thread_LockMutex(b->mutex); b->called++;