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 d61a821ad0)
v3.5.13-sru
OBATA Akio 4 years ago committed by Slávek Banko
parent e647983f52
commit 4562c4d1e1
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -314,7 +314,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:
{

Loading…
Cancel
Save