diff options
author | mread <qt-info@nokia.com> | 2011-02-17 13:45:38 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2011-03-09 12:47:32 (GMT) |
commit | 3a9ed967f793abe5049c91217f47d63c9457c1db (patch) | |
tree | ec65cb47e70c3ec4b5a8c23a22204058038a534a /src/corelib/thread | |
parent | c5a462519a8bce0faa31ce41414022749e3ad2f5 (diff) | |
download | Qt-3a9ed967f793abe5049c91217f47d63c9457c1db.zip Qt-3a9ed967f793abe5049c91217f47d63c9457c1db.tar.gz Qt-3a9ed967f793abe5049c91217f47d63c9457c1db.tar.bz2 |
further review fixes for qthread_symbian.cpp
Removed a call to get the symbian thread handle when we already had it.
Improved error reporting on failure.
Task-number: QTBUG-13990
Reviewed-by: Shane Kearns
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qthread_symbian.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/corelib/thread/qthread_symbian.cpp b/src/corelib/thread/qthread_symbian.cpp index 096cd6d..ce93f9f 100644 --- a/src/corelib/thread/qthread_symbian.cpp +++ b/src/corelib/thread/qthread_symbian.cpp @@ -46,6 +46,7 @@ #include "qthreadstorage.h" #include "qthread_p.h" #include "qdebug.h" +#include "qsystemerror_p.h" #include <sched.h> #include <errno.h> @@ -279,12 +280,6 @@ void *QThreadPrivate::start(void *arg) thr->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag)); } - // Because Symbian Open C does not provide a way to convert between - // RThread and pthread_t, we must delay initialization of the RThread - // handle when creating a thread, until we are running in the new thread. - // Here, we pick up the current thread and assign that to the handle. - init_symbian_thread_handle(data->symbian_thread_handle); - // On symbian, threads other than the main thread are non critical by default // This means a worker thread can crash without crashing the application - to // use this feature, we would need to use RThread::Logon in the main thread @@ -459,19 +454,14 @@ void QThread::start(Priority priority) // operations like file I/O fail, so we increase it by default. d->stackSize = 0x14000; // Maximum stack size on Symbian. - int code = 0; - if (d->data->symbian_thread_handle.Create(KNullDesC, (TThreadFunction) QThreadPrivate::start, d->stackSize, NULL, this) == KErrNone) - { + int code = d->data->symbian_thread_handle.Create(KNullDesC, (TThreadFunction) QThreadPrivate::start, d->stackSize, NULL, this); + if (code == KErrNone) { d->thread_id = d->data->symbian_thread_handle.Id(); TThreadPriority symPriority = calculateSymbianPriority(priority); d->data->symbian_thread_handle.SetPriority(symPriority); d->data->symbian_thread_handle.Resume(); - } - else - code = ENOMEM; // probably the problem - - if (code) { - qWarning("QThread::start: Thread creation error: %s", qPrintable(qt_error_string(code))); + } else { + qWarning("QThread::start: Thread creation error: %s", QSystemError(code, QSystemError::NativeError).toString()); d->running = false; d->finished = false; |