diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-11-22 09:44:13 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-11-22 09:44:13 +0100 |
commit | b949404dd90ae944017eb9b875a5920b747bb25d (patch) | |
tree | 75b228c4d9a237bb05b87b0e3eb8006f3b5c9c79 /src/threading.c | |
parent | 29385b4b1ad2df501e4306c7e908d7d1f2608eef (diff) | |
download | lanes-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.c | 7 |
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 |