From 4d9c275a63e976fc411d2c02014e002161811c47 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 1 May 2015 18:00:04 +0000 Subject: QPID-6526: fix to last commit, lock needs to be held for attach git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1677197 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpp') diff --git a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index ffc4247ee3..74b490bb5f 100644 --- a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp @@ -1252,7 +1252,10 @@ void ConnectionContext::startTxSession(boost::shared_ptr session QPID_LOG(debug, id << " attaching transaction for " << session->getName()); boost::shared_ptr tx(new Transaction(session->session)); session->transaction = tx; - attach(session, boost::shared_ptr(tx)); + { + sys::Monitor::ScopedLock l(lock); + attach(session, boost::shared_ptr(tx)); + } tx->declare(boost::bind(&ConnectionContext::send, this, _1, _2, _3, _4, _5), session); } catch (const Exception& e) { throw TransactionError(Msg() << "Cannot start transaction: " << e.what()); -- cgit v1.2.1