Fix to detect Thread Execution Scheduling support correctly

If `_POSIX_THREAD_PRIORITY_SCHEDULING == 0`, it must be checked
with sysconf(_SC_THREAD_PRIORITY_SCHEDULING) at runtime.

Signed-off-by: OBATA Akio <obache@wizdas.com>
pull/41/head
OBATA Akio 4 years ago
parent ecbbc92b78
commit 48a9cf9a3c

@ -331,7 +331,10 @@ void TQThread::start(Priority priority)
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
#if !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
#if _POSIX_THREAD_PRIORITY_SCHEDULING == 0 && defined _SC_THREAD_PRIORITY_SCHEDULING
if (sysconf(_SC_THREAD_PRIORITY_SCHEDULING) > 0)
#endif
switch (priority) {
case InheritPriority:
{

Loading…
Cancel
Save