Author: tabish
Date: Fri Jan 30 22:01:29 2009
New Revision: 739423
URL: http://svn.apache.org/viewvc?rev=739423&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-220
Patch to avoid leaking conditions from APR Pool
Modified:
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/util/concurrent/Mutex.cpp
Modified:
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/util/concurrent/Mutex.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/util/concurrent/Mutex.cpp?rev=739423&r1=739422&r2=739423&view=diff
==============================================================================
---
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/util/concurrent/Mutex.cpp
(original)
+++
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/decaf/util/concurrent/Mutex.cpp
Fri Jan 30 22:01:29 2009
@@ -103,7 +103,11 @@
// Create this threads wait event
apr_thread_cond_t* waitEvent = NULL;
- apr_thread_cond_create( &waitEvent, aprPool.getAprPool() );
+ apr_pool_t *subPool = NULL;
+ apr_pool_create_ex(&subPool, aprPool.getAprPool(), NULL, NULL);
+
+
+ apr_thread_cond_create( &waitEvent, subPool );
// Store the event in the queue so that a notify can
// call it and wake up the thread.
@@ -122,6 +126,7 @@
// Destroy our wait event now, the notify method will have removed it
// from the event queue.
apr_thread_cond_destroy( waitEvent );
+ apr_pool_destroy( subPool );
// restore the owner
this->lock_owner = lock_owner;