summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-11-12 16:58:36 +0000
committerAlan Conway <aconway@apache.org>2013-11-12 16:58:36 +0000
commitc9b6567bbd2167284d357f4021954e8e5f976b67 (patch)
tree9e4268af69b2cbc05b082216104b4306d03d8261
parentba564948e875e681f640c8e3e84e2e3253760936 (diff)
downloadqpid-python-c9b6567bbd2167284d357f4021954e8e5f976b67.tar.gz
QPID-5275: Add missing lock to ExchangeRegistry::registerExchange
Discovered while working on QPID-5275: ExchangeRegistry::registerExchange was not taking the write lock. Caused sporadic core dumps in ha_tests.py, tx_block_threads. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1541145 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp b/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
index 34a31fe769..c43e6afc89 100644
--- a/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
+++ b/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
@@ -146,6 +146,7 @@ Exchange::shared_ptr ExchangeRegistry::get(const string& name) {
}
bool ExchangeRegistry::registerExchange(const Exchange::shared_ptr& ex) {
+ RWlock::ScopedWlock locker(lock);
return exchanges.insert(ExchangeMap::value_type(ex->getName(), ex)).second;
}