diff options
| author | Alan Conway <aconway@apache.org> | 2009-02-11 17:29:42 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-02-11 17:29:42 +0000 |
| commit | 86d5aa7ccc3fb6e9cf23a52e8b2d69aae53692f7 (patch) | |
| tree | c9474aaa4a191b8ac5aba63a03f45a5c227cf067 /cpp/src/qpid/sys/posix/AsynchIO.cpp | |
| parent | 67460e0818bd5617cb84a6ae44c33ef8a11ac0a0 (diff) | |
| download | qpid-python-86d5aa7ccc3fb6e9cf23a52e8b2d69aae53692f7.tar.gz | |
Fix race condition with read-credit.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@743416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/posix/AsynchIO.cpp')
| -rw-r--r-- | cpp/src/qpid/sys/posix/AsynchIO.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/sys/posix/AsynchIO.cpp b/cpp/src/qpid/sys/posix/AsynchIO.cpp index 8b87039dc8..a356a72650 100644 --- a/cpp/src/qpid/sys/posix/AsynchIO.cpp +++ b/cpp/src/qpid/sys/posix/AsynchIO.cpp @@ -267,6 +267,7 @@ public: virtual void queueWriteClose(); virtual bool writeQueueEmpty(); virtual void startReading(); + virtual void stopReading(); virtual void requestCallback(RequestCallback); virtual BufferBase* getQueuedBuffer(); @@ -389,6 +390,10 @@ void AsynchIO::startReading() { DispatchHandle::rewatchRead(); } +void AsynchIO::stopReading() { + DispatchHandle::unwatchRead(); +} + void AsynchIO::requestCallback(RequestCallback callback) { // TODO creating a function object every time isn't all that // efficient - if this becomes heavily used do something better (what?) @@ -439,8 +444,7 @@ void AsynchIO::readable(DispatchHandle& h) { readTotal += rc; if (!readCallback(*this, buff)) { - // We were told to flow control reading at this point - h.unwatchRead(); + // We have been flow controlled. break; } |
