summaryrefslogtreecommitdiff
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
commit071e2890ac74336378cf58533d72060f6f754b3d (patch)
tree38b883c809d48d732949083bfaf94d49ab341944
parent3c6f6ae497d886e16b67f08e7f7a44f870345025 (diff)
downloadqpid-python-071e2890ac74336378cf58533d72060f6f754b3d.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/qpid@1177412 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/broker/Message.cpp6
1 files changed, 6 insertions, 0 deletions
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<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);
}