summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_win.cpp
diff options
context:
space:
mode:
authorSze Howe Koh <szehowe.koh@gmail.com>2012-10-19 00:33:03 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-19 20:25:16 +0200
commitd7e8b57d0a98696a05cfb0eb15236a34301d9d0a (patch)
tree31926a55d022a399ae09eb85ad41a5e369d80215 /src/corelib/thread/qthread_win.cpp
parent39eaff6773fc4f05fc95473b769b3a2f0301e12b (diff)
Remove the QThread::terminated() signal
The signal is removed from the API; all references to it are removed from documentation; the unit test that checks for its emission is modified to listen for QThread::finished() instead. The QThreadPrivate::terminated flag is also removed, as it served no purpose other than to trigger the emission of QThread::terminated() As discussed at http://lists.qt-project.org/pipermail/development/2012-October/007216.html the signal is not guaranteed to be emitted after every termination, rendering it useless. Change-Id: I7b0c45d7889da0d33875545331606f2208ee56fc Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/thread/qthread_win.cpp')
-rw-r--r--src/corelib/thread/qthread_win.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index b487efffad..56e58fbcc3 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -352,18 +352,13 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway)
QMutexLocker locker(lockAnyway ? &d->mutex : 0);
d->isInFinish = true;
d->priority = QThread::InheritPriority;
- bool terminated = d->terminated;
void **tls_data = reinterpret_cast<void **>(&d->data->tls);
locker.unlock();
- if (terminated)
- emit thr->terminated();
emit thr->finished();
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QThreadStorageData::finish(tls_data);
locker.relock();
- d->terminated = false;
-
QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher;
if (eventDispatcher) {
d->data->eventDispatcher = 0;
@@ -443,7 +438,6 @@ void QThread::start(Priority priority)
d->running = true;
d->finished = false;
- d->terminated = false;
d->exited = false;
d->returnCode = 0;
@@ -524,7 +518,6 @@ void QThread::terminate()
return;
}
TerminateThread(d->handle, 0);
- d->terminated = true;
QThreadPrivate::finish(this, false);
}
@@ -562,7 +555,7 @@ bool QThread::wait(unsigned long time)
if (ret && !d->finished) {
// thread was terminated by someone else
- d->terminated = true;
+
QThreadPrivate::finish(this, false);
}
@@ -583,7 +576,6 @@ void QThread::setTerminationEnabled(bool enabled)
QMutexLocker locker(&d->mutex);
d->terminationEnabled = enabled;
if (enabled && d->terminatePending) {
- d->terminated = true;
QThreadPrivate::finish(thr, false);
locker.unlock(); // don't leave the mutex locked!
_endthreadex(0);