diff options
author | OBATA Akio <obache@wizdas.com> | 2020-08-04 18:30:08 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-08-06 17:52:39 +0900 |
commit | 81c391e477f4db9fffc093524120ba2c630c281c (patch) | |
tree | 498df5556092d3978bbd8d6735980a7fac16fcdf /src | |
parent | 4ee1f9d46e5ba77bc6da98ddb9cc2eae1933a501 (diff) | |
download | tqt3-81c391e477f4db9fffc093524120ba2c630c281c.tar.gz tqt3-81c391e477f4db9fffc093524120ba2c630c281c.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 48a9cf9a3c2866db8a68fd1ac6cce5627c507386)
Diffstat (limited to 'src')
-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 c0f02464f..7140d2796 100644 --- a/src/kernel/qthread_unix.cpp +++ b/src/kernel/qthread_unix.cpp @@ -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: { |