summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r--src/corelib/thread/qthread.cpp31
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) {