summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-07-12 18:06:14 (GMT)
committerToby Tomkins <toby.tomkins@nokia.com>2010-07-27 07:57:56 (GMT)
commitfc14f5861e18d2ebc8014bfd750a8c82cf166392 (patch)
treed177bfa270cf4f6398cfa7d44c56b1c1594f757d /src/corelib
parent13c752b82c4db6d9a254454060f8404df24a3532 (diff)
downloadQt-fc14f5861e18d2ebc8014bfd750a8c82cf166392.zip
Qt-fc14f5861e18d2ebc8014bfd750a8c82cf166392.tar.gz
Qt-fc14f5861e18d2ebc8014bfd750a8c82cf166392.tar.bz2
Fixed a possible hanging bug in the Symbian networking.
I haven't seen the bug happening in practice, but I decided to be safe rather than sorry. The rationale is that if a network request comes in, the select thread will signal the active object in the main thread, remove the socket from the set of monitored sockets, and then go to sleep in the waitCond.wait() call, waiting for reactivation by the QSelectMutexGrabber. However, in QEventDispatcherSymbian::socketFired(), if the event causes the socket to be deleted, reactivateSocketNotifier will never be called, and therefore the wait condition will never be terminated. Fixed by only entering the wait condition if a grabber has already written to the pipe, signalling that it wants the lock. AutoTest: Passed RevBy: Markus Goetz (cherry picked from commit fc260f7ce9c139da93e005b2b51ef37c4d23998d)
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index e86efb2..2717780 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -481,7 +481,8 @@ void QSelectThread::run()
updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
}
- m_waitCond.wait(&m_mutex);
+ if (FD_ISSET(m_pipeEnds[0], &readfds))
+ m_waitCond.wait(&m_mutex);
}
m_mutex.unlock();