diff options
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" : |
