You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mg...@apache.org on 2011/09/29 21:54:42 UTC

svn commit: r1177412 - /qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp

Author: mgoulish
Date: Thu Sep 29 19:54:42 2011
New Revision: 1177412

URL: http://svn.apache.org/viewvc?rev=1177412&view=rev
Log:
QPID-3304
( well, at least related to that jira ^^ )
Without these extra locks I got a broker SEGV during
a federation test.  100% reproducible, 5 times.
gsim suggested that this might be the issue.  After placing
these locks, no SEGV in many tries.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp?rev=1177412&r1=1177411&r2=1177412&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp Thu Sep 29 19:54:42 2011
@@ -59,6 +59,7 @@ Message::~Message() {}
 
 void Message::forcePersistent()
 {
+    sys::Mutex::ScopedLock l(lock);
     // only set forced bit if we actually need to force.
     if (! getAdapter().isPersistent(frames) ){
         forcePersistentPolicy = true;
@@ -95,16 +96,19 @@ bool Message::isImmediate() const
 
 const FieldTable* Message::getApplicationHeaders() const
 {
+    sys::Mutex::ScopedLock l(lock);
     return getAdapter().getApplicationHeaders(frames);
 }
 
 std::string Message::getAppId() const
 {
+    sys::Mutex::ScopedLock l(lock);
     return getAdapter().getAppId(frames);
 }
 
 bool Message::isPersistent() const
 {
+    sys::Mutex::ScopedLock l(lock);
     return (getAdapter().isPersistent(frames) || forcePersistentPolicy);
 }
 
@@ -319,6 +323,7 @@ const std::string X_QPID_TRACE("x-qpid.t
 
 bool Message::isExcluded(const std::vector<std::string>& excludes) const
 {
+    sys::Mutex::ScopedLock l(lock);
     const FieldTable* headers = getApplicationHeaders();
     if (headers) {
         std::string traceStr = headers->getAsString(X_QPID_TRACE);
@@ -490,6 +495,7 @@ void Message::resetDequeueCompleteCallba
 }
 
 uint8_t Message::getPriority() const {
+    sys::Mutex::ScopedLock l(lock);
     return getAdapter().getPriority(frames);
 }
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org