diff options
author | Gordon Sim <gsim@apache.org> | 2015-05-01 18:00:04 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2015-05-01 18:00:04 +0000 |
commit | 4d9c275a63e976fc411d2c02014e002161811c47 (patch) | |
tree | d1cc0e2434c3b6e15b336aaa8479c29b2a65c4ea /cpp | |
parent | 28049ce9cf686f00297170339505fd112c2721e4 (diff) | |
download | qpid-python-4d9c275a63e976fc411d2c02014e002161811c47.tar.gz |
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
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<SessionContext> session QPID_LOG(debug, id << " attaching transaction for " << session->getName()); boost::shared_ptr<Transaction> tx(new Transaction(session->session)); session->transaction = tx; - attach(session, boost::shared_ptr<SenderContext>(tx)); + { + sys::Monitor::ScopedLock l(lock); + attach(session, boost::shared_ptr<SenderContext>(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()); |