From 0a06e1baf9e6da5308582b9dc928f4d9fea508d0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 29 Dec 2016 17:11:24 +0100 Subject: Modernize the "thread" feature Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/thread/qthread_p.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/corelib/thread/qthread_p.h') diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 93f245ff6e..22a0669032 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -57,7 +57,9 @@ #include "QtCore/qthread.h" #include "QtCore/qmutex.h" #include "QtCore/qstack.h" +#if QT_CONFIG(thread) #include "QtCore/qwaitcondition.h" +#endif #include "QtCore/qmap.h" #include "QtCore/qcoreapplication.h" #include "private/qobject_p.h" @@ -141,7 +143,7 @@ private: using QVector::insert; }; -#ifndef QT_NO_THREAD +#if QT_CONFIG(thread) class Q_CORE_EXPORT QDaemonThread : public QThread { @@ -210,7 +212,7 @@ public: } }; -#else // QT_NO_THREAD +#else // QT_CONFIG(thread) class QThreadPrivate : public QObjectPrivate { @@ -231,7 +233,7 @@ public: Q_DECLARE_PUBLIC(QThread) }; -#endif // QT_NO_THREAD +#endif // QT_CONFIG(thread) class QThreadData { @@ -327,7 +329,7 @@ public: void init(); private: -#ifndef QT_NO_THREAD +#if QT_CONFIG(thread) void run() override; #endif }; -- cgit v1.2.3 From 67352c92761fcb2e2c6a98b24e1bf5f33805cb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 2 Jul 2018 22:24:35 +0200 Subject: Merge QThread class definitions We can reuse the main QThread definition for the no-thread configuration and avoid having to keep them in sync. Add stub definitions for member functions where needed. Change-Id: I128db11684a6040d09c4a4ce114f1399cba523f8 Reviewed-by: Lorn Potter --- src/corelib/thread/qthread_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/thread/qthread_p.h') diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 22a0669032..64e3f33191 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -222,6 +222,7 @@ public: mutable QMutex mutex; QThreadData *data; + bool running = false; static void setCurrentThread(QThread*) {} static QThread *threadForId(int) { return QThread::currentThread(); } -- cgit v1.2.3