summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qeventloop.cpp4
-rw-r--r--src/corelib/thread/qthread_p.h1
2 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index 6e4c2552c7..55291ff650 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -176,11 +176,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
}
//we need to protect from race condition with QThread::exit
-#ifndef QT_NO_THREAD
QMutexLocker locker(&static_cast<QThreadPrivate *>(QObjectPrivate::get(d->threadData->thread))->mutex);
-#else
- QMutexLocker locker(0);
-#endif
struct LoopReference {
QEventLoopPrivate *d;
QMutexLocker &locker;
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 60f28ee761..4ae0e23c2a 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -228,6 +228,7 @@ public:
void deref() {}
bool exited;
int returnCode;
+ mutable QMutex mutex;
Q_DECLARE_PUBLIC(QThread)
};