From b949404dd90ae944017eb9b875a5920b747bb25d Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Fri, 22 Nov 2013 09:44:13 +0100 Subject: MinGW-pthread supports -3/+3 thread priority range, so accept it API-side too --- src/threading.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/threading.c b/src/threading.c index 5fcc39b..63c39ae 100644 --- a/src/threading.c +++ b/src/threading.c @@ -740,10 +740,17 @@ bool_t THREAD_WAIT_IMPL( THREAD_T *ref, double secs) // PTHREAD_SCOPE_PROCESS not supported by win32-pthread as of version 2.9.1 //#define _PRIO_SCOPE PTHREAD_SCOPE_SYSTEM // but do we need this at all to start with? +#if defined __WINPTHREADS_VERSION + // see http://sourceforge.net/p/mingw-w64/code/6370/tree/trunk/mingw-w64-libraries/winpthreads/src/sched.c#l128 + #define _PRIO_HI (+15) + #define _PRIO_0 (0) + #define _PRIO_LO (-15) +#else // win32-pthread seems happy with direct -2..+2 instead of some other remapping #define _PRIO_HI (+2) #define _PRIO_0 (0) #define _PRIO_LO (-2) +#endif #else #error "Unknown OS: not implemented!" #endif -- cgit v1.2.3-55-g6feb