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/FanOutExchange.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/broker/FanOutExchange.cpp') diff --git a/cpp/src/qpid/broker/FanOutExchange.cpp b/cpp/src/qpid/broker/FanOutExchange.cpp index 79702394ad..ea2327c788 100644 --- a/cpp/src/qpid/broker/FanOutExchange.cpp +++ b/cpp/src/qpid/broker/FanOutExchange.cpp @@ -29,7 +29,7 @@ FanOutExchange::FanOutExchange(const std::string& _name) : Exchange(_name) {} FanOutExchange::FanOutExchange(const std::string& _name, bool _durable, const FieldTable& _args) : Exchange(_name, _durable, _args) {} bool FanOutExchange::bind(Queue::shared_ptr queue, const string& /*routingKey*/, const FieldTable* /*args*/){ - Mutex::ScopedLock locker(lock); + RWlock::ScopedWlock locker(lock); // Add if not already present. Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue); if (i == bindings.end()) { @@ -41,7 +41,7 @@ bool FanOutExchange::bind(Queue::shared_ptr queue, const string& /*routingKey*/, } bool FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, const FieldTable* /*args*/){ - Mutex::ScopedLock locker(lock); + RWlock::ScopedWlock locker(lock); Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue); if (i != bindings.end()) { bindings.erase(i); @@ -52,7 +52,7 @@ bool FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey* } void FanOutExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* /*args*/){ - Mutex::ScopedLock locker(lock); + RWlock::ScopedRlock locker(lock); for(Queue::vector::iterator i = bindings.begin(); i != bindings.end(); ++i){ msg.deliverTo(*i); } -- cgit v1.2.1