From a3861c46a7151a250fd06f54a60b9c1fe4bd6a1e Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 11 May 2012 12:19:07 +0000 Subject: QPID-3858: Added async queue deletion and mechanism to correctly wait for async completion of store deletion before destroying queue objects git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1337126 13f79535-47bb-0310-9956-ffa450edef68 --- .../storePerfTools/asyncPerf/MockTransactionContext.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp') diff --git a/cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp b/cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp index e564876daa..10be34c6f5 100644 --- a/cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp +++ b/cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp @@ -57,7 +57,7 @@ MockTransactionContext::TransactionContext::destroy() // --- Class MockTransactionContext --- -MockTransactionContext::MockTransactionContext(AsyncStoreImplPtr store, +MockTransactionContext::MockTransactionContext(qpid::asyncStore::AsyncStoreImpl* store, const std::string& xid) : m_store(store), m_txnHandle(store->createTxnHandle(xid)), @@ -190,30 +190,33 @@ MockTransactionContext::localPrepare() // protected void -MockTransactionContext::prepareComplete(const TransactionContext* /*tc*/) +MockTransactionContext::prepareComplete(const TransactionContext* tc) { qpid::sys::ScopedLock l(m_enqueuedMsgsMutex); while (!m_enqueuedMsgs.empty()) { m_enqueuedMsgs.front()->clearTransaction(); m_enqueuedMsgs.pop_front(); } -//std::cout << "~~~~~ Transaction xid=\"" << getXid() << "\": prepareComplete()" << std::endl; +//std::cout << "~~~~~ Transaction xid=\"" << tc->m_tc->getXid() << "\": prepareComplete()" << std::endl << std::flush; + assert(tc->m_tc == this); } // protected void -MockTransactionContext::abortComplete(const TransactionContext* /*tc*/) +MockTransactionContext::abortComplete(const TransactionContext* tc) { -//std::cout << "~~~~~ Transaction xid=\"" << getXid() << "\": abortComplete()" << std::endl; +//std::cout << "~~~~~ Transaction xid=\"" << tc->m_tc->getXid() << "\": abortComplete()" << std::endl << std::flush; + assert(tc->m_tc == this); } // protected void -MockTransactionContext::commitComplete(const TransactionContext* /*tc*/) +MockTransactionContext::commitComplete(const TransactionContext* tc) { -//std::cout << "~~~~~ Transaction xid=\"" << getXid() << "\": commitComplete()" << std::endl; +//std::cout << "~~~~~ Transaction xid=\"" << tc->m_tc->getXid() << "\": commitComplete()" << std::endl << std::flush; + assert(tc->m_tc == this); } }}} // namespace tests::storePerftools::asyncPerf -- cgit v1.2.1