summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2015-05-01 18:00:04 +0000
committerGordon Sim <gsim@apache.org>2015-05-01 18:00:04 +0000
commit9c2ff9ab3ed372494e14394065dd0b61d3b948b7 (patch)
tree32d452ce1061d2f133ae4ce04bdeb4d7794ef894
parente616850745d92d523733703689d1db4902df9a8b (diff)
downloadqpid-python-9c2ff9ab3ed372494e14394065dd0b61d3b948b7.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@1677197 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
index ffc4247ee3..74b490bb5f 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
+++ b/qpid/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());