diff options
author | OBATA Akio <[email protected]> | 2020-08-04 18:30:08 +0900 |
---|---|---|
committer | OBATA Akio <[email protected]> | 2020-08-04 18:36:32 +0900 |
commit | 48a9cf9a3c2866db8a68fd1ac6cce5627c507386 (patch) | |
tree | b6e3f7451ff8416e527650c53b0949a6c1362a7a /src/kernel | |
parent | ecbbc92b782d07377d8b8130eb2dfc31f376578d (diff) | |
download | tqt3-48a9cf9a3c2866db8a68fd1ac6cce5627c507386.tar.gz tqt3-48a9cf9a3c2866db8a68fd1ac6cce5627c507386.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 <[email protected]>
Diffstat (limited to 'src/kernel')
-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 5a6ad877e..0c1790c2d 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: { |