From 99d4f0026f90681974f6fd1d23941e5b69024796 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 29 Dec 2016 18:59:04 +0100 Subject: Make the stub implementation of QThread compile again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We cannot inline methods of QThreadPrivate because QThreadData has to be declared before. The global QThreadData needs to be accessible to QThreadData::clearCurrentThreadData(), and QAdoptedThread::run() has to be moved inside the #ifndef QT_NO_THREAD block as run() doesn't exist in the stub and Q_DECL_OVERRIDE would be wrong. We also fix the QThreadData::current() method to take and use the same parameters as in the non-stub case. Change-Id: Id29ca44b11fa95ed2df7cc39243a07ce7d3c455e Reviewed-by: Ulf Hermann Reviewed-by: Oswald Buddenhagen Reviewed-by: Morten Johan Sørvig --- src/corelib/thread/qthread_p.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 46294a5fc8..73736ce13b 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -215,9 +215,10 @@ public: class QThreadPrivate : public QObjectPrivate { public: - QThreadPrivate(QThreadData *d = 0) : data(d ? d : new QThreadData) {} - ~QThreadPrivate() { delete data; } + QThreadPrivate(QThreadData *d = 0); + ~QThreadPrivate(); + mutable QMutex mutex; QThreadData *data; static void setCurrentThread(QThread*) {} @@ -318,7 +319,9 @@ public: void init(); private: +#ifndef QT_NO_THREAD void run() override; +#endif }; QT_END_NAMESPACE -- cgit v1.2.3