diff options
author | Alan Conway <aconway@apache.org> | 2008-11-11 20:58:59 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-11 20:58:59 +0000 |
commit | ce71dffee41acc012536afa37465cfac214d5439 (patch) | |
tree | ad851f8050a12550cae58db535365df87d454b2b | |
parent | c118b395ce2c025683e485ec5c37b62c4ef650a8 (diff) | |
download | qpid-python-ce71dffee41acc012536afa37465cfac214d5439.tar.gz |
Fix deadlock when Message::flush() re-enters IncompleteMessageList.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713165 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/broker/IncompleteMessageList.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/IncompleteMessageList.cpp b/cpp/src/qpid/broker/IncompleteMessageList.cpp index 64562dfb57..bfa7b5dd62 100644 --- a/cpp/src/qpid/broker/IncompleteMessageList.cpp +++ b/cpp/src/qpid/broker/IncompleteMessageList.cpp @@ -47,9 +47,12 @@ void IncompleteMessageList::process(const CompletionListener& listen, bool sync) boost::intrusive_ptr<Message>& msg = incomplete.front(); if (!msg->isEnqueueComplete()) { if (sync){ - msg->flush(); + { + sys::Mutex::ScopedUnlock u(lock); + msg->flush(); // Can re-enter IncompleteMessageList::enqueueComplete + } while (!msg->isEnqueueComplete()) - lock.wait(); + lock.wait(); } else { //leave the message as incomplete for now return; |