summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/Session.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/Session.cpp b/cpp/src/qpid/broker/Session.cpp
index d3f82655d0..8e8632e922 100644
--- a/cpp/src/qpid/broker/Session.cpp
+++ b/cpp/src/qpid/broker/Session.cpp
@@ -535,7 +535,13 @@ void Session::ConsumerImpl::addMessageCredit(uint32_t value)
void Session::ConsumerImpl::flush()
{
+ //need to prevent delivery after requestDispatch returns but
+ //before credit is reduced to zero; TODO: come up with better
+ //implementation of flush.
+ Mutex::ScopedLock l(lock);
queue->requestDispatch(this, true);
+ byteCredit = 0;
+ msgCredit = 0;
}
void Session::ConsumerImpl::stop()