From 13a373d975a60d45b2dd6de4c3cc821296330e16 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 22 May 2007 09:50:45 +0000 Subject: Patch submitted to qpid-dev by ksmith@redhat.com. Fixes concurrency issues arising from previous move to use singleton apr pool. "My patch does three things: 1) Modifies the APRPool class to use alloc/free semantics for APR memory pools. Each time a caller calls APRPool::get() they'll their own pool reference. I've fixed up all the call sites I can find to also call APRPool::free() at the appropriate time. 2) Caches freed APR memory pools in a STL stack. This cuts down on the number of memory pools created overall. 3) As a result of doing #1 and #2 I've introduced a guard mutex around APRPool::get() and APRPool::free(). This is to prevent concurrent access to the memory pool cache. If it's too heavyweight, the mutex along with the caching mechanism could be removed entirely." git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@540511 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/broker/QueueRegistry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpp/lib/broker/QueueRegistry.cpp') diff --git a/cpp/lib/broker/QueueRegistry.cpp b/cpp/lib/broker/QueueRegistry.cpp index 2d1382ef09..c69d553b06 100644 --- a/cpp/lib/broker/QueueRegistry.cpp +++ b/cpp/lib/broker/QueueRegistry.cpp @@ -28,7 +28,9 @@ using namespace qpid::sys; QueueRegistry::QueueRegistry(MessageStore* const _store) : counter(1), store(_store){} -QueueRegistry::~QueueRegistry(){} +QueueRegistry::~QueueRegistry() +{ +} std::pair QueueRegistry::declare(const string& declareName, bool durable, -- cgit v1.2.1