OSDN Git Service

do not set priority member from QThread::setPriority() prior to pthread_setschedparam...
authorIvailo Monev <xakepa10@laimg.moc>
Sat, 18 Jan 2020 03:28:26 +0000 (03:28 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sat, 18 Jan 2020 03:28:26 +0000 (03:28 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/thread/qthread_unix.cpp

index 5711b29..e91383f 100644 (file)
@@ -496,8 +496,6 @@ void QThread::setPriority(Priority priority)
         return;
     }
 
-    d->priority = priority;
-
     // copied from start() with a few modifications:
 
 #ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
@@ -534,6 +532,8 @@ void QThread::setPriority(Priority priority)
     Q_UNUSED(status);
 # endif // SCHED_IDLE
 #endif
+
+    d->priority = priority;
 }
 
 #include "moc_qthread.h"