From 50388a560d44c3bd7fd51bf3003dd373c5ce2b2c Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Thu, 21 Nov 2013 14:34:13 +0100 Subject: Add a dummy pthread_attr_setschedpolicy() for MinGW builds to fix a ENOTSUP failure. --- src/threading.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/threading.c b/src/threading.c index 85ee0c0..e6eb40e 100644 --- a/src/threading.c +++ b/src/threading.c @@ -522,6 +522,23 @@ bool_t THREAD_WAIT_IMPL( THREAD_T *ref, double secs) // On Linux, SCHED_RR and su privileges are required.. !-( // #include + +# if defined(__MINGW32__) || defined(__MINGW64__) + // 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. + static int pthread_attr_setschedpolicy( pthread_attr_t* attr, int policy) + { + if( policy != SCHED_OTHER) + { + return ENOTSUP; + } + return 0; + } +# 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" : -- cgit v1.2.3-55-g6feb