summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/AsyncCompletion.h8
-rw-r--r--qpid/cpp/src/qpid/broker/SemanticState.cpp12
-rw-r--r--qpid/cpp/src/qpid/broker/SessionState.cpp2
-rw-r--r--qpid/cpp/src/qpid/broker/SessionState.h4
-rw-r--r--qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp2
5 files changed, 15 insertions, 13 deletions
diff --git a/qpid/cpp/src/qpid/broker/AsyncCompletion.h b/qpid/cpp/src/qpid/broker/AsyncCompletion.h
index 0cf2856584..1ab69f32d3 100644
--- a/qpid/cpp/src/qpid/broker/AsyncCompletion.h
+++ b/qpid/cpp/src/qpid/broker/AsyncCompletion.h
@@ -91,7 +91,13 @@ class AsyncCompletion : public virtual RefCounted
*/
class Callback : public RefCounted
{
- public:
+ public:
+ // Normally RefCounted objects cannot be copied.
+ // Allow Callback objects to be copied (by subclasses implementing clone())
+ // The copy has an initial refcount of 0
+ Callback(const Callback&) : RefCounted() {}
+ Callback() {}
+
virtual void completed(bool) = 0;
virtual boost::intrusive_ptr<Callback> clone() = 0;
};
diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp
index 94e680c211..3e2a4cbb3c 100644
--- a/qpid/cpp/src/qpid/broker/SemanticState.cpp
+++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp
@@ -221,7 +221,7 @@ void SemanticState::startDtx(const std::string& xid, DtxManager& mgr, bool join)
if (!dtxSelected) {
throw CommandInvalidException(QPID_MSG("Session has not been selected for use with dtx"));
}
- dtxBuffer.reset(new DtxBuffer(xid));
+ dtxBuffer = new DtxBuffer(xid);
txBuffer = dtxBuffer;
session.getBroker().getBrokerObservers().startDtx(dtxBuffer);
if (join) {
@@ -242,7 +242,7 @@ void SemanticState::endDtx(const std::string& xid, bool fail)
}
- txBuffer.reset();//ops on this session no longer transactional
+ txBuffer = 0;//ops on this session no longer transactional
checkDtxTimeout();
if (fail) {
@@ -250,7 +250,7 @@ void SemanticState::endDtx(const std::string& xid, bool fail)
} else {
dtxBuffer->markEnded();
}
- dtxBuffer.reset();
+ dtxBuffer = 0;
}
void SemanticState::suspendDtx(const std::string& xid)
@@ -259,12 +259,12 @@ void SemanticState::suspendDtx(const std::string& xid)
throw CommandInvalidException(
QPID_MSG("xid specified on start was " << dtxBuffer->getXid() << ", but " << xid << " specified on suspend"));
}
- txBuffer.reset();//ops on this session no longer transactional
+ txBuffer = 0;//ops on this session no longer transactional
checkDtxTimeout();
dtxBuffer->setSuspended(true);
suspendedXids[xid] = dtxBuffer;
- dtxBuffer.reset();
+ dtxBuffer = 0;
}
void SemanticState::resumeDtx(const std::string& xid)
@@ -297,7 +297,7 @@ void SemanticState::resumeDtx(const std::string& xid)
void SemanticState::checkDtxTimeout()
{
if (dtxBuffer->isExpired()) {
- dtxBuffer.reset();
+ dtxBuffer = 0;
throw DtxTimeoutException();
}
}
diff --git a/qpid/cpp/src/qpid/broker/SessionState.cpp b/qpid/cpp/src/qpid/broker/SessionState.cpp
index 8e128ae0df..555163089e 100644
--- a/qpid/cpp/src/qpid/broker/SessionState.cpp
+++ b/qpid/cpp/src/qpid/broker/SessionState.cpp
@@ -398,7 +398,7 @@ void SessionState::IncompleteIngressMsgXfer::completed(bool sync)
session->completeCommand(id, requiresAccept, requiresSync);
}
}
- completerContext.reset();
+ completerContext = 0;
}
diff --git a/qpid/cpp/src/qpid/broker/SessionState.h b/qpid/cpp/src/qpid/broker/SessionState.h
index ad29c4427b..9fe38636a3 100644
--- a/qpid/cpp/src/qpid/broker/SessionState.h
+++ b/qpid/cpp/src/qpid/broker/SessionState.h
@@ -259,10 +259,6 @@ class SessionState : public qpid::SessionState,
completerContext(ss.getAsyncCommandCompleter())
{}
- AsyncCommandContext(const AsyncCommandContext& x) :
- id(x.id), requiresSync(x.requiresSync), completerContext(x.completerContext)
- {}
-
virtual ~AsyncCommandContext() {}
protected:
diff --git a/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp b/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
index ca833cf085..0f8ed0a0a7 100644
--- a/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
+++ b/qpid/cpp/src/qpid/ha/PrimaryTxObserver.cpp
@@ -200,7 +200,7 @@ void PrimaryTxObserver::end(sys::Mutex::ScopedLock&) {
// Don't destroy the tx-queue until the transaction is complete and there
// are no connected subscriptions.
if (txBuffer && complete && unfinished.empty()) {
- txBuffer.reset(); // Break pointer cycle.
+ txBuffer = 0; // Break pointer cycle.
try {
haBroker.getBroker().deleteQueue(txQueue->getName(), haBroker.getUserId(), string());
} catch (const std::exception& e) {