diff options
author | mread <qt-info@nokia.com> | 2011-02-17 13:07:51 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2011-03-09 12:47:22 (GMT) |
commit | c5a462519a8bce0faa31ce41414022749e3ad2f5 (patch) | |
tree | 381bb17971f6860277b6f98ef10a3f243caf8e63 /src/corelib | |
parent | 04510ff7b065b27f2a80f2cbf42cb097c98923b0 (diff) | |
download | Qt-c5a462519a8bce0faa31ce41414022749e3ad2f5.zip Qt-c5a462519a8bce0faa31ce41414022749e3ad2f5.tar.gz Qt-c5a462519a8bce0faa31ce41414022749e3ad2f5.tar.bz2 |
Symbian adopted thread monitor review fixes
The adopted thread monitor could cause a stray event panic if multiple
threads where added quickly. A new autotest was written to force the
fault (successfully). A fix was then added.
Task-number: QTBUG-13990
Reviewed-by: Shane Kearns
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/thread/qthread_symbian.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_symbian.cpp b/src/corelib/thread/qthread_symbian.cpp index 4bbf5e3..096cd6d 100644 --- a/src/corelib/thread/qthread_symbian.cpp +++ b/src/corelib/thread/qthread_symbian.cpp @@ -161,13 +161,13 @@ public: } void DoCancel() { - TRequestStatus *stat = &iStatus; User::RequestComplete(stat, KErrCancel); } void start() { iStatus = KRequestPending; SetActive(); + stat = &iStatus; } void RunL() { @@ -195,9 +195,8 @@ public: monitorThread.Close(); } adoptedThreadAdder->threadsToAdd.push_back(thread); - if (adoptedThreadAdder->IsActive()) { - TRequestStatus *stat = &adoptedThreadAdder->iStatus; - adoptedThreadAdder->monitorThread.RequestComplete(stat, KErrNone); + if (adoptedThreadAdder->stat) { + adoptedThreadAdder->monitorThread.RequestComplete(adoptedThreadAdder->stat, KErrNone); } } static void monitorThreadFuncL() @@ -232,6 +231,7 @@ private: RThread monitorThread; static QMutex adoptedThreadMonitorMutex; static QCAddAdoptedThread* adoptedThreadAdder; + TRequestStatus *stat; }; QMutex QCAddAdoptedThread::adoptedThreadMonitorMutex; |