From a48c9eddce4cbc56521fca7fd64582d9dafe1d40 Mon Sep 17 00:00:00 2001 From: "Carl C. Trieloff" Date: Thu, 5 Jul 2007 16:19:05 +0000 Subject: - Added RW lock - Updated all exchanges to us RW lock - Updated all registries to us RW lock - Still need to do (client, channel, message and queues) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@553549 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/DirectExchange.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/broker/DirectExchange.cpp') diff --git a/cpp/src/qpid/broker/DirectExchange.cpp b/cpp/src/qpid/broker/DirectExchange.cpp index 7b516414c0..87f363ff3d 100644 --- a/cpp/src/qpid/broker/DirectExchange.cpp +++ b/cpp/src/qpid/broker/DirectExchange.cpp @@ -30,7 +30,7 @@ DirectExchange::DirectExchange(const string& _name) : Exchange(_name) {} DirectExchange::DirectExchange(const std::string& _name, bool _durable, const FieldTable& _args) : Exchange(_name, _durable, _args) {} bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable*){ - Mutex::ScopedLock l(lock); + RWlock::ScopedWlock l(lock); std::vector& queues(bindings[routingKey]); std::vector::iterator i = find(queues.begin(), queues.end(), queue); if (i == queues.end()) { @@ -42,7 +42,7 @@ bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, con } bool DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){ - Mutex::ScopedLock l(lock); + RWlock::ScopedWlock l(lock); std::vector& queues(bindings[routingKey]); std::vector::iterator i = find(queues.begin(), queues.end(), queue); @@ -58,7 +58,7 @@ bool DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, c } void DirectExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* /*args*/){ - Mutex::ScopedLock l(lock); + RWlock::ScopedRlock l(lock); std::vector& queues(bindings[routingKey]); int count(0); for(std::vector::iterator i = queues.begin(); i != queues.end(); i++, count++){ -- cgit v1.2.1