diff options
author | Alan Conway <aconway@apache.org> | 2013-10-29 15:23:36 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2013-10-29 15:23:36 +0000 |
commit | 7033bf67ab672fafc57d374f8a727cc8e4b7c54e (patch) | |
tree | f077354174c8ab5e303b8e848d277a7308911564 /qpid/cpp/src/qpid/ha/Primary.cpp | |
parent | 8303ede7e98c64c44d8186552873c091130485a9 (diff) | |
download | qpid-python-7033bf67ab672fafc57d374f8a727cc8e4b7c54e.tar.gz |
QPID-5139: Make TxBuffer inherit from AsyncCompletion.
Switched from shared_ptr to intrusive_ptr for TxBuffer and DtxBuffer.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1536752 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/ha/Primary.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/ha/Primary.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/ha/Primary.cpp b/qpid/cpp/src/qpid/ha/Primary.cpp index e7fdc5035f..3a7ab3b0fc 100644 --- a/qpid/cpp/src/qpid/ha/Primary.cpp +++ b/qpid/cpp/src/qpid/ha/Primary.cpp @@ -40,12 +40,14 @@ #include "qpid/sys/Timer.h" #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> +#include <boost/intrusive_ptr.hpp> namespace qpid { namespace ha { using sys::Mutex; using boost::shared_ptr; +using boost::intrusive_ptr; using namespace std; using namespace framing; @@ -69,8 +71,8 @@ class PrimaryBrokerObserver : public broker::BrokerObserver void queueDestroy(const Primary::QueuePtr& q) { primary.queueDestroy(q); } void exchangeCreate(const Primary::ExchangePtr& q) { primary.exchangeCreate(q); } void exchangeDestroy(const Primary::ExchangePtr& q) { primary.exchangeDestroy(q); } - void startTx(const shared_ptr<broker::TxBuffer>& tx) { primary.startTx(tx); } - void startDtx(const shared_ptr<broker::DtxBuffer>& dtx) { primary.startDtx(dtx); } + void startTx(const intrusive_ptr<broker::TxBuffer>& tx) { primary.startTx(tx); } + void startDtx(const intrusive_ptr<broker::DtxBuffer>& dtx) { primary.startDtx(dtx); } private: Primary& primary; @@ -406,11 +408,11 @@ shared_ptr<PrimaryTxObserver> Primary::makeTxObserver() { return observer; } -void Primary::startTx(const boost::shared_ptr<broker::TxBuffer>& tx) { +void Primary::startTx(const boost::intrusive_ptr<broker::TxBuffer>& tx) { tx->setObserver(makeTxObserver()); } -void Primary::startDtx(const boost::shared_ptr<broker::DtxBuffer>& dtx) { +void Primary::startDtx(const boost::intrusive_ptr<broker::DtxBuffer>& dtx) { dtx->setObserver(makeTxObserver()); } |