diff options
author | bnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68> | 2002-07-24 14:35:43 +0000 |
---|---|---|
committer | bnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68> | 2002-07-24 14:35:43 +0000 |
commit | c1d47602d005beebaac6c6478be09ee1a0d41ac1 (patch) | |
tree | 9f0060b566eb0ed2749beb169608ea88aec49fe8 /misc | |
parent | 733c3157c148b0d3a83a5476666f5556f8bbe1e3 (diff) | |
download | libapr-c1d47602d005beebaac6c6478be09ee1a0d41ac1.tar.gz |
Divided the cstat() memory pool into per processor memory pools to avoid having
two different processors return the same memory node on an apr_palloc().
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63728 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc')
-rw-r--r-- | misc/netware/libprews.c | 21 | ||||
-rw-r--r-- | misc/netware/start.c | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c index 8213636b8..192efa519 100644 --- a/misc/netware/libprews.c +++ b/misc/netware/libprews.c @@ -19,7 +19,7 @@ typedef struct app_data { int initialized; - void* gPool; + void* gPool[MAX_PROCESSORS]; void* statCache[MAX_PROCESSORS]; } APP_DATA; @@ -151,26 +151,34 @@ int DisposeLibraryData(void *data) return 0; } -int setGlobalPool(void *data) +int setGlobalPool(void *data, int proc) { APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { + return 0; + } + NXLock(gLibLock); - if (app_data && !app_data->gPool) { - app_data->gPool = data; + if (app_data && !app_data->gPool[proc]) { + app_data->gPool[proc] = data; } NXUnlock(gLibLock); return 1; } -void* getGlobalPool() +void* getGlobalPool(int proc) { APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); + if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { + return NULL; + } + if (app_data) { - return app_data->gPool; + return app_data->gPool[proc]; } return NULL; @@ -181,7 +189,6 @@ int setStatCache(void *data, int proc) APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId); if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) { - data = NULL; return 0; } diff --git a/misc/netware/start.c b/misc/netware/start.c index 64c6c0a9d..fc12e21d4 100644 --- a/misc/netware/start.c +++ b/misc/netware/start.c @@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void) } apr_signal_init(pool); - setGlobalPool((void*)pool); +// setGlobalPool((void*)pool); return APR_SUCCESS; } |