summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_symbian.cpp
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-02-17 13:07:51 (GMT)
committermread <qt-info@nokia.com>2011-03-09 12:47:22 (GMT)
commitc5a462519a8bce0faa31ce41414022749e3ad2f5 (patch)
tree381bb17971f6860277b6f98ef10a3f243caf8e63 /src/corelib/thread/qthread_symbian.cpp
parent04510ff7b065b27f2a80f2cbf42cb097c98923b0 (diff)
downloadQt-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/thread/qthread_symbian.cpp')
-rw-r--r--src/corelib/thread/qthread_symbian.cpp8
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;