From 38d03690204493a95b0b2453f17933c6a34e2aaf Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Thu, 21 Nov 2013 16:09:57 +0100 Subject: Correct MinGW pthread_attr_setschedpolicy replacement. --- src/threading.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/threading.c b/src/threading.c index e6eb40e..5fcc39b 100644 --- a/src/threading.c +++ b/src/threading.c @@ -523,12 +523,13 @@ bool_t THREAD_WAIT_IMPL( THREAD_T *ref, double secs) // #include -# if defined(__MINGW32__) || defined(__MINGW64__) +# if ((defined(__MINGW32__) || defined(__MINGW64__)) && pthread_attr_setschedpolicy == ENOTSUP) // from the mingw-w64 team: // Well, we support pthread_setschedparam by which you can specify // threading-policy. Nevertheless, yes we lack this function. In // general its implementation is pretty much trivial, as on Win32 target // just SCHED_OTHER can be supported. + #undef pthread_attr_setschedpolicy static int pthread_attr_setschedpolicy( pthread_attr_t* attr, int policy) { if( policy != SCHED_OTHER) @@ -539,7 +540,6 @@ bool_t THREAD_WAIT_IMPL( THREAD_T *ref, double secs) } # endif // defined(__MINGW32__) || defined(__MINGW64__) - // static void _PT_FAIL( int rc, const char *name, const char *file, uint_t line ) { const char *why= (rc==EINVAL) ? "EINVAL" : (rc==EBUSY) ? "EBUSY" : -- cgit v1.2.3-55-g6feb