You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2008/11/11 21:59:00 UTC
svn commit: r713165 -
/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp
Author: aconway
Date: Tue Nov 11 12:58:59 2008
New Revision: 713165
URL: http://svn.apache.org/viewvc?rev=713165&view=rev
Log:
Fix deadlock when Message::flush() re-enters IncompleteMessageList.
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp?rev=713165&r1=713164&r2=713165&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp Tue Nov 11 12:58:59 2008
@@ -47,9 +47,12 @@
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;