From 58337ca40df3a57a16cdee9b7f6b4fe0361b0018 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 15 Jun 2012 19:21:07 +0000 Subject: 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 --- .../tests/storePerftools/asyncPerf/QueueAsyncContext.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp') diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp b/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp index 4836f9358a..07a80c8a33 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp @@ -31,10 +31,12 @@ namespace storePerftools { namespace asyncPerf { QueueAsyncContext::QueueAsyncContext(boost::shared_ptr q, + qpid::broker::TxnHandle& th, const qpid::asyncStore::AsyncOperation::opCode op, qpid::broker::AsyncResultCallback rcb, qpid::broker::AsyncResultQueue* const arq) : m_q(q), + m_th(th), m_op(op), m_rcb(rcb), m_arq(arq) @@ -44,11 +46,13 @@ QueueAsyncContext::QueueAsyncContext(boost::shared_ptr q QueueAsyncContext::QueueAsyncContext(boost::shared_ptr q, boost::intrusive_ptr msg, + qpid::broker::TxnHandle& th, const qpid::asyncStore::AsyncOperation::opCode op, qpid::broker::AsyncResultCallback rcb, qpid::broker::AsyncResultQueue* const arq) : m_q(q), m_msg(msg), + m_th(th), m_op(op), m_rcb(rcb), m_arq(arq) @@ -84,6 +88,12 @@ QueueAsyncContext::getMessage() const return m_msg; } +qpid::broker::TxnHandle +QueueAsyncContext::getTxnHandle() const +{ + return m_th; +} + qpid::broker::AsyncResultQueue* QueueAsyncContext::getAsyncResultQueue() const { @@ -99,7 +109,9 @@ QueueAsyncContext::getAsyncResultCallback() const void QueueAsyncContext::invokeCallback(const qpid::broker::AsyncResultHandle* const arh) const { - m_rcb(arh); + if (m_rcb) { + m_rcb(arh); + } } void -- cgit v1.2.1