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:34 +0100 |
commit | d61a821ad0c5508dd2e34232370a66034b348886 (patch) | |
tree | 6fdd866c7c40c59f91ce9955f71312c6c73044cc | |
parent | 53ff73cc35d415708fd6b5dbb0fd747d244e759d (diff) | |
download | qt3-d61a821ad0c5508dd2e34232370a66034b348886.tar.gz qt3-d61a821ad0c5508dd2e34232370a66034b348886.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>
-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: { |