summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-03-15 14:24:32 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-03-15 14:24:32 +0000
commitc842178487b58b61660ea7cfc6d496fa5bac07d7 (patch)
treeb7b8b230892d77aeca54e988956b3451f37c7598 /cpp/include
parentda02a78692ad6cec4a103ae65206c166d19f065d (diff)
downloadqpid-python-c842178487b58b61660ea7cfc6d496fa5bac07d7.tar.gz
QPID-3893: C++ broker appears to segfault during MultipleTransactedBatchProducerTest
Added in lock to preserve the previous read/write concurrency guarantees of FieldTable in the face of the new caching. Fix extra unnecessary decodes git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1301001 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/qpid/framing/FieldTable.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/cpp/include/qpid/framing/FieldTable.h b/cpp/include/qpid/framing/FieldTable.h
index 293fb2eed7..1986a72d10 100644
--- a/cpp/include/qpid/framing/FieldTable.h
+++ b/cpp/include/qpid/framing/FieldTable.h
@@ -1,3 +1,6 @@
+#ifndef _FieldTable_
+#define _FieldTable_
+
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -18,16 +21,17 @@
* under the License.
*
*/
-#include <iostream>
-#include <vector>
+
+#include "qpid/framing/amqp_types.h"
+#include "qpid/sys/Mutex.h"
+
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
+
+#include <iosfwd>
#include <map>
-#include "qpid/framing/amqp_types.h"
-#include "qpid/CommonImportExport.h"
-#ifndef _FieldTable_
-#define _FieldTable_
+#include "qpid/CommonImportExport.h"
namespace qpid {
/**
@@ -114,11 +118,13 @@ class FieldTable
private:
void realDecode() const;
- void flushRawCache() const;
+ void flushRawCache();
+ mutable qpid::sys::Mutex lock;
mutable ValueMap values;
mutable boost::shared_array<uint8_t> cachedBytes;
mutable uint32_t cachedSize; // if = 0 then non cached size as 0 is not a legal size
+ mutable bool newBytes;
QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream& out, const FieldTable& body);
};