apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr/include/arch/netware apr_private.h
Date Wed, 24 Jul 2002 14:35:43 GMT
bnicholes    2002/07/24 07:35:43

  Modified:    misc/netware start.c libprews.c
               file_io/netware filestat.c
               include/arch/netware apr_private.h
  Log:
  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().
  
  Revision  Changes    Path
  1.8       +1 -1      apr/misc/netware/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/netware/start.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- start.c	13 Apr 2002 19:27:24 -0000	1.7
  +++ start.c	24 Jul 2002 14:35:43 -0000	1.8
  @@ -110,7 +110,7 @@
       }
       
       apr_signal_init(pool);
  -    setGlobalPool((void*)pool);
  +//    setGlobalPool((void*)pool);
   
       return APR_SUCCESS;
   }
  
  
  
  1.7       +14 -7     apr/misc/netware/libprews.c
  
  Index: libprews.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/netware/libprews.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- libprews.c	26 Jun 2002 22:01:02 -0000	1.6
  +++ libprews.c	24 Jul 2002 14:35:43 -0000	1.7
  @@ -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 @@
       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 @@
       APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
   
       if ((proc < 0) || (proc > (MAX_PROCESSORS-1))) {
  -        data = NULL;
           return 0;
       }
   
  
  
  
  1.14      +14 -5     apr/file_io/netware/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/netware/filestat.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- filestat.c	26 Jun 2002 22:01:02 -0000	1.13
  +++ filestat.c	24 Jul 2002 14:35:43 -0000	1.14
  @@ -220,7 +220,7 @@
   int cstat (const char *path, struct stat *buf, char **casedName, apr_pool_t *pool)
   {
       apr_hash_t *statCache = (apr_hash_t *)getStatCache(CpuCurrentProcessor);
  -    apr_pool_t *gPool = (apr_pool_t *)getGlobalPool();
  +    apr_pool_t *gPool = (apr_pool_t *)getGlobalPool(CpuCurrentProcessor);
       apr_stat_entry_t *stat_entry;
       struct stat *info;
       apr_time_t now = apr_time_now();
  @@ -233,10 +233,19 @@
       /* If there isn't a global pool then just stat the file
          and return */
       if (!gPool) {
  -        ret = stat(path, buf);
  -        if (ret == 0)
  -            *casedName = case_filename(pool, path);
  -        return ret;
  +        char poolname[50];
  +
  +        if (apr_pool_create(&gPool, NULL) != APR_SUCCESS) {
  +            ret = stat(path, buf);
  +            if (ret == 0)
  +                *casedName = case_filename(pool, path);
  +            return ret;
  +        }
  +
  +        sprintf (poolname, "cstat_mem_pool_%d", CpuCurrentProcessor);
  +        apr_pool_tag(gPool, poolname);
  +
  +        setGlobalPool(gPool, CpuCurrentProcessor);
       }
   
       /* If we have a statCache hash table then use it.
  
  
  
  1.12      +2 -2      apr/include/arch/netware/apr_private.h
  
  Index: apr_private.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/netware/apr_private.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- apr_private.h	15 Jul 2002 20:16:17 -0000	1.11
  +++ apr_private.h	24 Jul 2002 14:35:43 -0000	1.12
  @@ -169,8 +169,8 @@
   int unregister_NLM(void *NLMHandle);
   
   /* Application global data management */
  -int setGlobalPool(void *data);
  -void* getGlobalPool();
  +int setGlobalPool(void *data, int proc);
  +void* getGlobalPool(int proc);
   int setStatCache(void *data, int proc);
   void* getStatCache(int proc);
   
  
  
  

Mime
View raw message