summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qwindowspipereader.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-09-29 17:55:32 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 08:05:55 +0200
commit94dc0c659425f091595dc77c03b9a94f446a65f8 (patch)
tree83f91700fa24e1fb0d10ce052e90ffe358741e16 /src/corelib/io/qwindowspipereader.cpp
parentd3c24d241e10ae36e768b93607fd3226c48751c6 (diff)
QWinOverlappedIoNotifier: multiple I/O operations on the same handle
When doing multiple I/O operations on the same handle, we get notified for every operations. These must be distinguished by comparing the pointer to the OVERLAPPED struct. We now pass the OVERLAPPED pointer via the notified signal and let the receiver decide if it wants to handle this notification. Change-Id: I4efe70f39c6ae5282b949f2f4b21f6e7dd3df785 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/corelib/io/qwindowspipereader.cpp')
-rw-r--r--src/corelib/io/qwindowspipereader.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index ea29e483bb..8a06a7ba21 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -68,7 +68,7 @@ QWindowsPipeReader::~QWindowsPipeReader()
{
if (readSequenceStarted) {
CancelIo(handle);
- dataReadNotifier->waitForNotified(-1);
+ dataReadNotifier->waitForNotified(-1, &overlapped);
}
}
@@ -156,8 +156,10 @@ bool QWindowsPipeReader::canReadLine() const
\internal
Will be called whenever the read operation completes.
*/
-void QWindowsPipeReader::notified(DWORD numberOfBytesRead, DWORD errorCode)
+void QWindowsPipeReader::notified(DWORD numberOfBytesRead, DWORD errorCode, OVERLAPPED *notifiedOverlapped)
{
+ if (&overlapped != notifiedOverlapped)
+ return;
if (!completeAsyncRead(numberOfBytesRead, errorCode)) {
pipeBroken = true;
emit pipeClosed();
@@ -281,7 +283,7 @@ bool QWindowsPipeReader::waitForReadyRead(int msecs)
if (!readSequenceStarted)
return false;
readyReadEmitted = false;
- dataReadNotifier->waitForNotified(msecs);
+ dataReadNotifier->waitForNotified(msecs, &overlapped);
return readyReadEmitted;
}