summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-08-19 13:39:55 (GMT)
committeraxis <qt-info@nokia.com>2009-08-19 13:41:43 (GMT)
commite9c2263b0be0696dca42a9f0f93c47674826b719 (patch)
tree80349e3107db583f84c8234a07c20e0ec6a45177
parentdc6c7b7b2fa5a1df1aa26cb170679a5f008fd20a (diff)
downloadQt-e9c2263b0be0696dca42a9f0f93c47674826b719.zip
Qt-e9c2263b0be0696dca42a9f0f93c47674826b719.tar.gz
Qt-e9c2263b0be0696dca42a9f0f93c47674826b719.tar.bz2
Added some comments after code review.
RevBy: Trust me
-rw-r--r--src/corelib/thread/qthread_unix.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index b0b285e..5401cfd 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -208,6 +208,7 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
void *QThreadPrivate::start(void *arg)
{
+ // Symbian Open C supports neither thread cancellation nor cleanup_push.
#ifndef Q_OS_SYMBIAN
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
pthread_cleanup_push(QThreadPrivate::finish, arg);
@@ -584,6 +585,11 @@ void QThread::terminate()
}
d->terminated = true;
+ // "false, false" meaning:
+ // 1. lockAnyway = false. Don't lock the mutex because it's already locked
+ // (see above).
+ // 2. closeNativeSymbianHandle = false. We don't want to close the thread handle,
+ // because we need it here to terminate the thread.
QThreadPrivate::finish(this, false, false);
d->data->symbian_thread_handle.Terminate(KErrNone);
d->data->symbian_thread_handle.Close();
@@ -627,6 +633,9 @@ void QThread::setTerminationEnabled(bool enabled)
d->terminationEnabled = enabled;
if (enabled && d->terminatePending) {
d->terminated = true;
+ // "false" meaning:
+ // - lockAnyway = false. Don't lock the mutex because it's already locked
+ // (see above).
QThreadPrivate::finish(thr, false);
locker.unlock(); // don't leave the mutex locked!
pthread_exit(NULL);