diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp index fb5675c129..6acd0a3ced 100644 --- a/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp +++ b/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp @@ -173,8 +173,13 @@ bool ReceiverImpl::fetchImpl(qpid::messaging::Message& message, qpid::messaging: if (getImpl(message, timeout)) { return true; } else { - if (state == CANCELLED) return false; // Might have been closed during get. - sync(session).messageFlush(destination); + qpid::client::Session s; + { + sys::Mutex::ScopedLock l(lock); + if (state == CANCELLED) return false; // Might have been closed during get. + s = sync(session); + } + s.messageFlush(destination); { sys::Mutex::ScopedLock l(lock); startFlow(l); //reallocate credit |