aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2013-11-21 16:09:57 +0100
committerBenoit Germain <bnt.germain@gmail.com>2013-11-21 16:09:57 +0100
commit38d03690204493a95b0b2453f17933c6a34e2aaf (patch)
tree5e223587bf3bec87bf183dcc9ba1559d06fa7446 /src
parent50388a560d44c3bd7fd51bf3003dd373c5ce2b2c (diff)
downloadlanes-38d03690204493a95b0b2453f17933c6a34e2aaf.tar.gz
lanes-38d03690204493a95b0b2453f17933c6a34e2aaf.tar.bz2
lanes-38d03690204493a95b0b2453f17933c6a34e2aaf.zip
Correct MinGW pthread_attr_setschedpolicy replacement.
Diffstat (limited to 'src')
-rw-r--r--src/threading.c4
1 files 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)
523 // 523 //
524 #include <errno.h> 524 #include <errno.h>
525 525
526# if defined(__MINGW32__) || defined(__MINGW64__) 526# if ((defined(__MINGW32__) || defined(__MINGW64__)) && pthread_attr_setschedpolicy == ENOTSUP)
527 // from the mingw-w64 team: 527 // from the mingw-w64 team:
528 // Well, we support pthread_setschedparam by which you can specify 528 // Well, we support pthread_setschedparam by which you can specify
529 // threading-policy. Nevertheless, yes we lack this function. In 529 // threading-policy. Nevertheless, yes we lack this function. In
530 // general its implementation is pretty much trivial, as on Win32 target 530 // general its implementation is pretty much trivial, as on Win32 target
531 // just SCHED_OTHER can be supported. 531 // just SCHED_OTHER can be supported.
532 #undef pthread_attr_setschedpolicy
532 static int pthread_attr_setschedpolicy( pthread_attr_t* attr, int policy) 533 static int pthread_attr_setschedpolicy( pthread_attr_t* attr, int policy)
533 { 534 {
534 if( policy != SCHED_OTHER) 535 if( policy != SCHED_OTHER)
@@ -539,7 +540,6 @@ bool_t THREAD_WAIT_IMPL( THREAD_T *ref, double secs)
539 } 540 }
540# endif // defined(__MINGW32__) || defined(__MINGW64__) 541# endif // defined(__MINGW32__) || defined(__MINGW64__)
541 542
542 //
543 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 ) {
544 const char *why= (rc==EINVAL) ? "EINVAL" : 544 const char *why= (rc==EINVAL) ? "EINVAL" :
545 (rc==EBUSY) ? "EBUSY" : 545 (rc==EBUSY) ? "EBUSY" :