aboutsummaryrefslogtreecommitdiff
path: root/src/threading.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2013-11-22 09:44:13 +0100
committerBenoit Germain <bnt.germain@gmail.com>2013-11-22 09:44:13 +0100
commitb949404dd90ae944017eb9b875a5920b747bb25d (patch)
tree75b228c4d9a237bb05b87b0e3eb8006f3b5c9c79 /src/threading.c
parent29385b4b1ad2df501e4306c7e908d7d1f2608eef (diff)
downloadlanes-b949404dd90ae944017eb9b875a5920b747bb25d.tar.gz
lanes-b949404dd90ae944017eb9b875a5920b747bb25d.tar.bz2
lanes-b949404dd90ae944017eb9b875a5920b747bb25d.zip
MinGW-pthread supports -3/+3 thread priority range, so accept it API-side too
Diffstat (limited to 'src/threading.c')
-rw-r--r--src/threading.c7
1 files changed, 7 insertions, 0 deletions
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)
740 // PTHREAD_SCOPE_PROCESS not supported by win32-pthread as of version 2.9.1 740 // PTHREAD_SCOPE_PROCESS not supported by win32-pthread as of version 2.9.1
741 //#define _PRIO_SCOPE PTHREAD_SCOPE_SYSTEM // but do we need this at all to start with? 741 //#define _PRIO_SCOPE PTHREAD_SCOPE_SYSTEM // but do we need this at all to start with?
742 742
743#if defined __WINPTHREADS_VERSION
744 // see http://sourceforge.net/p/mingw-w64/code/6370/tree/trunk/mingw-w64-libraries/winpthreads/src/sched.c#l128
745 #define _PRIO_HI (+15)
746 #define _PRIO_0 (0)
747 #define _PRIO_LO (-15)
748#else
743 // win32-pthread seems happy with direct -2..+2 instead of some other remapping 749 // win32-pthread seems happy with direct -2..+2 instead of some other remapping
744 #define _PRIO_HI (+2) 750 #define _PRIO_HI (+2)
745 #define _PRIO_0 (0) 751 #define _PRIO_0 (0)
746 #define _PRIO_LO (-2) 752 #define _PRIO_LO (-2)
753#endif
747#else 754#else
748 #error "Unknown OS: not implemented!" 755 #error "Unknown OS: not implemented!"
749#endif 756#endif