diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-06-15 19:21:07 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-06-15 19:21:07 +0000 |
commit | 58337ca40df3a57a16cdee9b7f6b4fe0361b0018 (patch) | |
tree | 391ad7ad1ea8cd42a7e9d4890c724b186e00f38b /cpp/src/qpid/asyncStore/TxnHandleImpl.h | |
parent | 01174a9e568f11cd5aa4f22aaa914e00ab9fe163 (diff) | |
download | qpid-python-58337ca40df3a57a16cdee9b7f6b4fe0361b0018.tar.gz |
QPID-3858: WIP - async txns for msg publish pathway, but there are some race/thread issues to sort out.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1350745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/asyncStore/TxnHandleImpl.h')
-rw-r--r-- | cpp/src/qpid/asyncStore/TxnHandleImpl.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cpp/src/qpid/asyncStore/TxnHandleImpl.h b/cpp/src/qpid/asyncStore/TxnHandleImpl.h index b28eb0cd4b..e357791508 100644 --- a/cpp/src/qpid/asyncStore/TxnHandleImpl.h +++ b/cpp/src/qpid/asyncStore/TxnHandleImpl.h @@ -24,23 +24,45 @@ #ifndef qpid_asyncStore_TxnHandleImpl_h_ #define qpid_asyncStore_TxnHandleImpl_h_ +#include "AtomicCounter.h" + #include "qpid/RefCounted.h" +#include <stdint.h> // uint32_t #include <string> namespace qpid { + +namespace broker { +class TxnBuffer; +} + namespace asyncStore { class TxnHandleImpl : public virtual qpid::RefCounted { public: - TxnHandleImpl(const std::string& xid = std::string()); + TxnHandleImpl(); + TxnHandleImpl(qpid::broker::TxnBuffer* tb); + TxnHandleImpl(const std::string& xid); + TxnHandleImpl(const std::string& xid, qpid::broker::TxnBuffer* tb); virtual ~TxnHandleImpl(); const std::string& getXid() const; bool is2pc() const; + + void submitPrepare(); + void submitCommit(); + void submitAbort(); + + void incrOpCnt(); + void decrOpCnt(); private: std::string m_xid; bool m_tpcFlag; + AsyncOpCounter m_asyncOpCnt; + qpid::broker::TxnBuffer* const m_txnBuffer; + + void createLocalXid(); }; }} // namespace qpid::asyncStore |