Added a thread-safe and robust wrapper for APR pools.
See http://redmine.imprudenceviewer.org/issues/590 and https://jira.secondlife.com/browse/SNOW-596
This commit is contained in:
@@ -201,7 +201,8 @@ bool LLPluginSharedMemory::create(size_t size)
|
||||
mName += createName();
|
||||
mSize = size;
|
||||
|
||||
apr_status_t status = apr_shm_create( &(mImpl->mAprSharedMemory), mSize, mName.c_str(), gAPRPoolp );
|
||||
mPool.create();
|
||||
apr_status_t status = apr_shm_create( &(mImpl->mAprSharedMemory), mSize, mName.c_str(), mPool());
|
||||
|
||||
if(ll_apr_warn_status(status))
|
||||
{
|
||||
@@ -224,7 +225,7 @@ bool LLPluginSharedMemory::destroy(void)
|
||||
}
|
||||
mImpl->mAprSharedMemory = NULL;
|
||||
}
|
||||
|
||||
mPool.destroy();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -233,7 +234,8 @@ bool LLPluginSharedMemory::attach(const std::string &name, size_t size)
|
||||
mName = name;
|
||||
mSize = size;
|
||||
|
||||
apr_status_t status = apr_shm_attach( &(mImpl->mAprSharedMemory), mName.c_str(), gAPRPoolp );
|
||||
mPool.create();
|
||||
apr_status_t status = apr_shm_attach( &(mImpl->mAprSharedMemory), mName.c_str(), mPool() );
|
||||
|
||||
if(ll_apr_warn_status(status))
|
||||
{
|
||||
@@ -255,6 +257,7 @@ bool LLPluginSharedMemory::detach(void)
|
||||
}
|
||||
mImpl->mAprSharedMemory = NULL;
|
||||
}
|
||||
mPool.destroy();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user