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:
Aleric Inglewood
2011-05-05 01:34:00 +02:00
parent 5b08560047
commit 4d932d5e2d
57 changed files with 895 additions and 751 deletions

View File

@@ -35,7 +35,6 @@
#include "linden_common.h"
#include "lltut.h"
#include "llapr.h"
#include "llmessagetemplate.h"
#include "llquaternion.h"
#include "lltemplatemessagebuilder.h"
@@ -59,7 +58,6 @@ namespace tut
static bool init = false;
if(! init)
{
ll_init_apr();
const F32 circuit_heartbeat_interval=5;
const F32 circuit_timeout=100;

View File

@@ -35,7 +35,6 @@
#include "linden_common.h"
#include "lltut.h"
#include "llapr.h"
#include "llmessageconfig.h"
#include "llsdserialize.h"
#include "llversionserver.h"
@@ -68,7 +67,6 @@ namespace tut
static bool init = false;
if(!init)
{
ll_init_apr();
//init_prehash_data();
init = true;
}

View File

@@ -43,8 +43,8 @@
#include "linden_common.h"
#include "llerrorcontrol.h"
#include "lltut.h"
#include "aiaprpool.h"
#include "apr_pools.h"
#include "apr_getopt.h"
extern void ll_init_apr();
@@ -250,17 +250,12 @@ int main(int argc, char **argv)
ctype_workaround();
#endif
ll_init_apr();
apr_pool_t* pool = NULL;
if(APR_SUCCESS != apr_pool_create(&pool, NULL))
{
std::cerr << "Unable to initialize pool" << std::endl;
return 1;
}
AIAPRPool pool;
pool.create();
apr_getopt_t* os = NULL;
if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv))
if(APR_SUCCESS != apr_getopt_init(&os, pool(), argc, argv))
{
std::cerr << "Unable to pool" << std::endl;
std::cerr << "Unable to initialize the arguments for parsing by apr_getopt()." << std::endl;
return 1;
}
@@ -362,6 +357,5 @@ int main(int argc, char **argv)
s.close();
}
apr_terminate();
return 0;
}