summaryrefslogtreecommitdiff
path: root/misc/netware
diff options
context:
space:
mode:
authorBradley Nicholes <bnicholes@apache.org>2002-02-22 15:51:17 +0000
committerBradley Nicholes <bnicholes@apache.org>2002-02-22 15:51:17 +0000
commit35b406fee70997db27c43f66ab084eb96160097a (patch)
tree1e0434457e6bdcaf5025262caef8a41f38cda93b /misc/netware
parent7a0e7aa817df9a11a79df57309207ba5161a4f72 (diff)
downloadapr-35b406fee70997db27c43f66ab084eb96160097a.tar.gz
Added APIs for storing the global memory pool and the stat cache
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc/netware')
-rw-r--r--misc/netware/libprews.c51
-rw-r--r--misc/netware/start.c1
2 files changed, 52 insertions, 0 deletions
diff --git a/misc/netware/libprews.c b/misc/netware/libprews.c
index c1181d470..342ff2aea 100644
--- a/misc/netware/libprews.c
+++ b/misc/netware/libprews.c
@@ -17,6 +17,8 @@
typedef struct app_data {
int initialized;
+ void* gPool;
+ void* statCache;
} APP_DATA;
/* library-private data...*/
@@ -147,3 +149,52 @@ int DisposeLibraryData(void *data)
return 0;
}
+int setGlobalPool(void *data)
+{
+ APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
+
+ NXLock(gLibLock);
+
+ if (app_data && !app_data->gPool) {
+ app_data->gPool = data;
+ }
+
+ NXUnlock(gLibLock);
+ return 1;
+}
+
+void* getGlobalPool()
+{
+ APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
+
+ if (app_data) {
+ return app_data->gPool;
+ }
+
+ return NULL;
+}
+
+int setStatCache(void *data)
+{
+ APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
+
+ NXLock(gLibLock);
+
+ if (app_data && !app_data->statCache) {
+ app_data->statCache = data;
+ }
+
+ NXUnlock(gLibLock);
+ return 1;
+}
+
+void* getStatCache()
+{
+ APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
+
+ if (app_data) {
+ return app_data->statCache;
+ }
+
+ return NULL;
+}
diff --git a/misc/netware/start.c b/misc/netware/start.c
index dfef07403..1b92fae2f 100644
--- a/misc/netware/start.c
+++ b/misc/netware/start.c
@@ -109,6 +109,7 @@ APR_DECLARE(apr_status_t) apr_initialize(void)
}
apr_signal_init(pool);
+ setGlobalPool((void*)pool);
return APR_SUCCESS;
}