summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/src/qpid/sys/ClusterSafe.cpp6
-rw-r--r--cpp/src/qpid/sys/ClusterSafe.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/sys/ClusterSafe.cpp b/cpp/src/qpid/sys/ClusterSafe.cpp
index 6105fc96c7..c6b527dfdf 100644
--- a/cpp/src/qpid/sys/ClusterSafe.cpp
+++ b/cpp/src/qpid/sys/ClusterSafe.cpp
@@ -43,14 +43,14 @@ void assertClusterSafe() {
}
}
-ClusterSafeScope::ClusterSafeScope() {
- assert(!inContext);
+ClusterSafeScope::ClusterSafeScope() {
+ save = inContext;
inContext = true;
}
ClusterSafeScope::~ClusterSafeScope() {
assert(inContext);
- inContext = false;
+ inContext = save;
}
void enableClusterSafe() { inCluster = true; }
diff --git a/cpp/src/qpid/sys/ClusterSafe.h b/cpp/src/qpid/sys/ClusterSafe.h
index f3382307d0..15675e8cc5 100644
--- a/cpp/src/qpid/sys/ClusterSafe.h
+++ b/cpp/src/qpid/sys/ClusterSafe.h
@@ -61,9 +61,12 @@ QPID_COMMON_EXTERN bool isCluster();
* and provides functions to assist detecting bugs in cluster
* behavior.
*/
-struct ClusterSafeScope {
+class ClusterSafeScope {
+ public:
ClusterSafeScope();
~ClusterSafeScope();
+ private:
+ bool save;
};
/**