diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-11-21 14:34:13 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-11-21 14:34:13 +0100 |
commit | 50388a560d44c3bd7fd51bf3003dd373c5ce2b2c (patch) | |
tree | 047f583101e6b8127bc07d340c6c1094037ee535 /src | |
parent | bc2320a30965b2877b1e47790f0b432955d211f9 (diff) | |
download | lanes-50388a560d44c3bd7fd51bf3003dd373c5ce2b2c.tar.gz lanes-50388a560d44c3bd7fd51bf3003dd373c5ce2b2c.tar.bz2 lanes-50388a560d44c3bd7fd51bf3003dd373c5ce2b2c.zip |
Add a dummy pthread_attr_setschedpolicy() for MinGW builds to fix a ENOTSUP failure.
Diffstat (limited to 'src')
-rw-r--r-- | src/threading.c | 17 |
1 files changed, 17 insertions, 0 deletions
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) | |||
522 | // On Linux, SCHED_RR and su privileges are required.. !-( | 522 | // On Linux, SCHED_RR and su privileges are required.. !-( |
523 | // | 523 | // |
524 | #include <errno.h> | 524 | #include <errno.h> |
525 | |||
526 | # if defined(__MINGW32__) || defined(__MINGW64__) | ||
527 | // from the mingw-w64 team: | ||
528 | // Well, we support pthread_setschedparam by which you can specify | ||
529 | // threading-policy. Nevertheless, yes we lack this function. In | ||
530 | // general its implementation is pretty much trivial, as on Win32 target | ||
531 | // just SCHED_OTHER can be supported. | ||
532 | static int pthread_attr_setschedpolicy( pthread_attr_t* attr, int policy) | ||
533 | { | ||
534 | if( policy != SCHED_OTHER) | ||
535 | { | ||
536 | return ENOTSUP; | ||
537 | } | ||
538 | return 0; | ||
539 | } | ||
540 | # endif // defined(__MINGW32__) || defined(__MINGW64__) | ||
541 | |||
525 | // | 542 | // |
526 | static void _PT_FAIL( int rc, const char *name, const char *file, uint_t line ) { | 543 | static void _PT_FAIL( int rc, const char *name, const char *file, uint_t line ) { |
527 | const char *why= (rc==EINVAL) ? "EINVAL" : | 544 | const char *why= (rc==EINVAL) ? "EINVAL" : |