qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r576448 - /incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp
Date Mon, 17 Sep 2007 14:08:17 GMT
Author: gsim
Date: Mon Sep 17 07:08:17 2007
New Revision: 576448

URL: http://svn.apache.org/viewvc?rev=576448&view=rev
Log:
Fix for race between flush and delivery.


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp?rev=576448&r1=576447&r2=576448&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Session.cpp Mon Sep 17 07:08:17 2007
@@ -535,7 +535,13 @@
 
 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()



Mime
View raw message