summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2011-09-29 19:54:42 +0000
committerMichael Goulish <mgoulish@apache.org>2011-09-29 19:54:42 +0000
commit802522c8a1c57a3dc500f7c4de9a452f15968c29 (patch)
tree8c22954b9729064ff3dcbc03c64dbb21a54f0ece /qpid/cpp
parentfeaef60f5f9a468866de1c09a6cf20df42b9a946 (diff)
downloadqpid-python-802522c8a1c57a3dc500f7c4de9a452f15968c29.tar.gz
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@1177412 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/broker/Message.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp
index 992a94f92e..5ea7143366 100644
--- a/qpid/cpp/src/qpid/broker/Message.cpp
+++ b/qpid/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<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::resetDequeueCompleteCallback() {
}
uint8_t Message::getPriority() const {
+ sys::Mutex::ScopedLock l(lock);
return getAdapter().getPriority(frames);
}