X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=thread_null.c;h=a38a15b6f68fda6be37376343b3479e03789c117;hp=5d788a49ba99ada73e63a23a7ca1279a9f16ba69;hb=aacd9507d824694ed13d9ba8c5c33c3aba87ab63;hpb=9cffca779de91e174191e4a853211892e44b605e diff --git a/thread_null.c b/thread_null.c index 5d788a49..a38a15b6 100644 --- a/thread_null.c +++ b/thread_null.c @@ -10,61 +10,115 @@ void Thread_Shutdown(void) { } -qboolean Thread_HasThreads(void) +qbool Thread_HasThreads(void) { return false; } -void *Thread_CreateMutex(void) +void *_Thread_CreateMutex(const char *filename, int fileline) { return NULL; } -void Thread_DestroyMutex(void *mutex) +void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) { } -int Thread_LockMutex(void *mutex) +int _Thread_LockMutex(void *mutex, const char *filename, int fileline) { return -1; } -int Thread_UnlockMutex(void *mutex) +int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline) { return -1; } -void *Thread_CreateCond(void) +void *_Thread_CreateCond(const char *filename, int fileline) { return NULL; } -void Thread_DestroyCond(void *cond) +void _Thread_DestroyCond(void *cond, const char *filename, int fileline) { } -int Thread_CondSignal(void *cond) +int _Thread_CondSignal(void *cond, const char *filename, int fileline) { return -1; } -int Thread_CondBroadcast(void *cond) +int _Thread_CondBroadcast(void *cond, const char *filename, int fileline) { return -1; } -int Thread_CondWait(void *cond, void *mutex) +int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline) { return -1; } -void *Thread_CreateThread(int (*fn)(void *), void *data) +void *_Thread_CreateThread(int (*fn)(void *), void *data, const char *filename, int fileline) { return NULL; } -int Thread_WaitThread(void *thread, int retval) +int _Thread_WaitThread(void *thread, int retval, const char *filename, int fileline) { return retval; } - + +void *_Thread_CreateBarrier(unsigned int count, const char *filename, int fileline) +{ + return NULL; +} + +void _Thread_DestroyBarrier(void *barrier, const char *filename, int fileline) +{ +} + +void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) +{ +} + +int _Thread_AtomicGet(Thread_Atomic *a, const char *filename, int fileline) +{ + return a->value; +} + +int _Thread_AtomicSet(Thread_Atomic *a, int v, const char *filename, int fileline) +{ + int value = a->value; + a->value = v; + return value; +} + +int _Thread_AtomicAdd(Thread_Atomic *a, int v, const char *filename, int fileline) +{ + int value = a->value; + a->value += v; + return value; +} + +void _Thread_AtomicIncRef(Thread_Atomic *a, const char *filename, int fileline) +{ + a->value++; +} + +qbool _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline) +{ + return a->value++ == 1; +} + +qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline) +{ + return true; +} + +void _Thread_AtomicLock(Thread_SpinLock *lock, const char *filename, int fileline) +{ +} + +void _Thread_AtomicUnlock(Thread_SpinLock *lock, const char *filename, int fileline) +{ +}