summaryrefslogtreecommitdiff
path: root/cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2012-05-11 12:19:07 +0000
committerKim van der Riet <kpvdr@apache.org>2012-05-11 12:19:07 +0000
commita3861c46a7151a250fd06f54a60b9c1fe4bd6a1e (patch)
tree05da4567a96e4e3461f7aae7c76494d8111cd3b4 /cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp
parent7ed6d96613a02d53a34a5c8e8d524a0b3c19d83d (diff)
downloadqpid-python-a3861c46a7151a250fd06f54a60b9c1fe4bd6a1e.tar.gz
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
Diffstat (limited to 'cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp')
-rw-r--r--cpp/src/tests/storePerfTools/asyncPerf/MockTransactionContext.cpp17
1 files changed, 10 insertions, 7 deletions
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<qpid::sys::Mutex> 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