diff options
author | OBATA Akio <obache@wizdas.com> | 2020-08-04 18:30:08 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-02-02 01:53:47 +0100 |
commit | 0fe2b27c819f536e7f678c8595d81120fab3c6ed (patch) | |
tree | 88ad6004eb59bc283cc26b34d37c5e404e48d3b6 | |
parent | 41bd48d0cee5e2707753010aaae7d72bb59e255d (diff) | |
download | qt3-0fe2b27c819f536e7f678c8595d81120fab3c6ed.tar.gz qt3-0fe2b27c819f536e7f678c8595d81120fab3c6ed.zip |
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>
(cherry picked from commit d61a821ad0c5508dd2e34232370a66034b348886)
-rw-r--r-- | src/kernel/qthread_unix.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp index 1358250..6b43b0b 100644 --- a/src/kernel/qthread_unix.cpp +++ b/src/kernel/qthread_unix.cpp @@ -331,7 +331,10 @@ void QThread::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: { |