add mutex to global mem pool and tweak var code

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12705 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-03-21 16:47:57 +00:00
parent b7db753142
commit 14415b29f1
2 changed files with 8 additions and 7 deletions

View File

@@ -569,11 +569,12 @@ switch_memory_pool_t *switch_core_memory_init(void)
abort();
}
if ((apr_thread_mutex_create(&my_mutex, APR_THREAD_MUTEX_DEFAULT, memory_manager.memory_pool)) != APR_SUCCESS) {
if ((apr_thread_mutex_create(&my_mutex, APR_THREAD_MUTEX_NESTED, memory_manager.memory_pool)) != APR_SUCCESS) {
abort();
}
apr_allocator_mutex_set(my_allocator, my_mutex);
apr_pool_mutex_set(memory_manager.memory_pool, my_mutex);
apr_allocator_owner_set(my_allocator, memory_manager.memory_pool);
#else
apr_pool_create(&memory_manager.memory_pool, NULL);