From 6ac580a1cf9cfe114aca1e108610b06720922f2b Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 18 Jan 2020 17:05:06 +0000 Subject: [PATCH] Add the needed functions for TaskQueue in thread_null.c and add taskqueue.c to makefile. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12499 d7cf8633-e32d-0410-b094-e92efae38249 --- makefile.inc | 1 + thread_null.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/makefile.inc b/makefile.inc index 326e3a4a..de68b709 100644 --- a/makefile.inc +++ b/makefile.inc @@ -148,6 +148,7 @@ OBJ_COMMON= \ svbsp.o \ svvm_cmds.o \ sys_shared.o \ + taskqueue.o \ vid_shared.o \ view.o \ wad.o \ diff --git a/thread_null.c b/thread_null.c index 35c4e4b5..66981583 100644 --- a/thread_null.c +++ b/thread_null.c @@ -80,3 +80,45 @@ 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++; +} + +qboolean _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline) +{ + return a->value++ == 1; +} + +qboolean _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) +{ +} -- 2.39.2