diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-16 03:50:31 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-16 03:50:31 (GMT) |
commit | ac0fc4e9b0ed314e7d49e8dc0e9ded0922aab8e9 (patch) | |
tree | 58eb9feaa85fb02c3c15980f58964b112ca9d02d /src/corelib/thread/qthread.cpp | |
parent | 140a96d0b860b045c18d53c1ac96e77b3893d31c (diff) | |
parent | 551d704cdafae46cdccc6217bb7f36da7e84be2d (diff) | |
download | Qt-ac0fc4e9b0ed314e7d49e8dc0e9ded0922aab8e9.zip Qt-ac0fc4e9b0ed314e7d49e8dc0e9ded0922aab8e9.tar.gz Qt-ac0fc4e9b0ed314e7d49e8dc0e9ded0922aab8e9.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (34 commits)
Fix duplicate project entry in visual studio solution file.
Doc
qdoc: Added the index and fixed images in the extra files list.
Speed up qsTr() by caching the translation context
Crash while printing from the portedcanvas example on Mac Cocoa.
qdoc: Fixed .qdocconf files for assistant.
Disable debug-only framework builds on Mac.
Compile (with -no-pch)
Add missing QT_NO_BEARERMANAGEMENT ifdefs.
Introduce a qconfig feature for Bearer Management
Fix MOBILITY-404
Remove holes in bearer management data structures.
Don't link bearer plugins against QtGui unnecessarily.
Added missing newline after warning message when using -L with qml
Doc: updating scripts
Fixed a crash on embedded due to uninitialized pointer.
Fix a race where QThread::exit() is "lost" when called after start()
qdoc: Removed all <table> attributes in favor of using css.
Autotest failure: dialogModality test fails on cocoa (macgui)
Force the bic test to compile in 32-bit mode on Mac
...
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r-- | src/corelib/thread/qthread.cpp | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index c35eb28..cdcb65c 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -174,7 +174,7 @@ void QAdoptedThread::run() QThreadPrivate::QThreadPrivate(QThreadData *d) : QObjectPrivate(), running(false), finished(false), terminated(false), - stackSize(0), priority(QThread::InheritPriority), data(d), object(0) + stackSize(0), priority(QThread::InheritPriority), data(d) { #if defined (Q_OS_UNIX) thread_id = 0; @@ -377,9 +377,6 @@ QThread::QThread(QObject *parent) Q_D(QThread); // fprintf(stderr, "QThreadData %p created for thread %p\n", d->data, this); d->data->thread = this; - - d->object = new QThreadPrivateInternalObject; - d->object->moveToThread(this); } /*! \internal @@ -390,8 +387,6 @@ QThread::QThread(QThreadPrivate &dd, QObject *parent) Q_D(QThread); // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this); d->data->thread = this; - - // do not create the internal object for adopted threads } /*! @@ -413,9 +408,6 @@ QThread::~QThread() d->data->thread = 0; } - - delete d->object; - d->object = 0; } /*! @@ -488,11 +480,11 @@ uint QThread::stackSize() const int QThread::exec() { Q_D(QThread); - QMutexLocker locker(&d->mutex); - d->data->quitNow = false; QEventLoop eventLoop; - locker.unlock(); int returnCode = eventLoop.exec(); + + QMutexLocker locker(&d->mutex); + d->data->quitNow = false; return returnCode; } @@ -518,21 +510,6 @@ int QThread::exec() void QThread::exit(int returnCode) { Q_D(QThread); - if (d->object) { - QMetaObject::invokeMethod(d->object, "exit", Q_ARG(int, returnCode)); - } else { - QMutexLocker locker(&d->mutex); - d->data->quitNow = true; - for (int i = 0; i < d->data->eventLoops.size(); ++i) { - QEventLoop *eventLoop = d->data->eventLoops.at(i); - eventLoop->exit(returnCode); - } - } -} - -void QThreadPrivateInternalObject::exit(int returnCode) -{ - QThreadPrivate *d = static_cast<QThreadPrivate *>(QObjectPrivate::get(thread())); QMutexLocker locker(&d->mutex); d->data->quitNow = true; for (int i = 0; i < d->data->eventLoops.size(); ++i) { |