From 071e2890ac74336378cf58533d72060f6f754b3d Mon Sep 17 00:00:00 2001 From: Michael Goulish Date: Thu, 29 Sep 2011 19:54:42 +0000 Subject: 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. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1177412 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Message.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpp') diff --git a/cpp/src/qpid/broker/Message.cpp b/cpp/src/qpid/broker/Message.cpp index 992a94f92e..5ea7143366 100644 --- a/cpp/src/qpid/broker/Message.cpp +++ b/cpp/src/qpid/broker/Message.cpp @@ -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.trace"); bool Message::isExcluded(const std::vector& 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::resetDequeueCompleteCallback() { } uint8_t Message::getPriority() const { + sys::Mutex::ScopedLock l(lock); return getAdapter().getPriority(frames); } -- cgit v1.2.1