summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-25 02:31:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-25 02:31:56 (GMT)
commite868e896054061f35b38dd3e7b688d932be40a55 (patch)
tree75eb8d69df9bd07f93dd1a75dd7d014486b11bd6 /src/corelib/thread/qthread.cpp
parent7f2877acd0183092c31b74ed0de8d54fb3c49caf (diff)
parent25c9b6ed488b1446cbdd38186992957264596314 (diff)
downloadQt-e868e896054061f35b38dd3e7b688d932be40a55.zip
Qt-e868e896054061f35b38dd3e7b688d932be40a55.tar.gz
Qt-e868e896054061f35b38dd3e7b688d932be40a55.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QThread: fix a race condition when destroying or restarting thread from finished() QThreadStorage: fix crash if thread local destructor reset himself Add WA_MacNoShadow widget attribute Doc: Fixing typo Fix compilation on symbian Fix a namespace error and some warnings found by clang optimize ligatureHelper by using qBinaryFind instead of the for loop QFileSystemWatcher: Do not require QApplication in the destructor. Do not define METHOD if QT_NO_KEYWORD is defined. QThreadPrivate::finish should not keep mutex locked when calling signals Make QThreadStorage supports value type and not only pointers. QThreadStorage: fix memory leak if thread storage are added while destroying Compile fix. Fix some warnings on Mac
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r--src/corelib/thread/qthread.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 69b70cb..71a4896 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -173,7 +173,8 @@ void QAdoptedThread::run()
*/
QThreadPrivate::QThreadPrivate(QThreadData *d)
- : QObjectPrivate(), running(false), finished(false), terminated(false), exited(false), returnCode(-1),
+ : QObjectPrivate(), running(false), finished(false), terminated(false),
+ isInFinish(false), exited(false), returnCode(-1),
stackSize(0), priority(QThread::InheritPriority), data(d)
{
#if defined (Q_OS_UNIX)
@@ -403,6 +404,11 @@ QThread::~QThread()
Q_D(QThread);
{
QMutexLocker locker(&d->mutex);
+ if (d->isInFinish) {
+ locker.unlock();
+ wait();
+ locker.relock();
+ }
if (d->running && !d->finished)
qWarning("QThread: Destroyed while thread is still running");