aboutsummaryrefslogtreecommitdiff
path: root/src/threading.h
diff options
context:
space:
mode:
authornia <nia@netbsd.org>2020-10-05 16:29:56 +0200
committernia <nia@netbsd.org>2020-10-05 16:29:56 +0200
commit1a678810b20c65dcc29f5310161ec9ce2be1cd65 (patch)
treed1760c1d11f26cdef877990391cffc0d980cc283 /src/threading.h
parent203790a68020186bf668b2787968aa0d901fc518 (diff)
downloadlanes-1a678810b20c65dcc29f5310161ec9ce2be1cd65.tar.gz
lanes-1a678810b20c65dcc29f5310161ec9ce2be1cd65.tar.bz2
lanes-1a678810b20c65dcc29f5310161ec9ce2be1cd65.zip
NetBSD support
This adds support for NetBSD's flavour of pthreads. There are minor differences in the declaration of the non-portable pthread functions, and sched_yield is provided instead of pthread_yield_np. This allows LuaLanes to build and the test suite to run on NetBSD.
Diffstat (limited to '')
-rw-r--r--src/threading.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/threading.h b/src/threading.h
index 063cc82..9761f82 100644
--- a/src/threading.h
+++ b/src/threading.h
@@ -143,7 +143,7 @@ enum e_status { PENDING, RUNNING, WAITING, DONE, ERROR_ST, CANCELLED };
143 // 143 //
144 #if defined( PLATFORM_OSX) 144 #if defined( PLATFORM_OSX)
145 #define YIELD() pthread_yield_np() 145 #define YIELD() pthread_yield_np()
146#elif defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC) || defined(__ANDROID__) // no PTHREAD for PLATFORM_XBOX 146#elif defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC) || defined(__ANDROID__) || defined(__NetBSD__) // no PTHREAD for PLATFORM_XBOX
147 // for some reason win32-pthread doesn't have pthread_yield(), but sched_yield() 147 // for some reason win32-pthread doesn't have pthread_yield(), but sched_yield()
148 #define YIELD() sched_yield() 148 #define YIELD() sched_yield()
149 #else 149 #else