httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_mem_cache.c
Date Mon, 10 Jun 2002 21:10:08 GMT
gregames    2002/06/10 14:10:08

  Modified:    modules/experimental mod_mem_cache.c
  Log:
  be consistant about how a couple of members of mem_cache_object_t are used
  and defined to silence compile errors on a system where apr_atomic_t is
  a structure.
  
  "pos" is read & written with atomic operators, so make it an apr_atomic_t.
  "priority" is almost always updated without using atomic operators, so I
  assume it doesn't need to be atomic.
  
  Revision  Changes    Path
  1.70      +7 -6      httpd-2.0/modules/experimental/mod_mem_cache.c
  
  Index: mod_mem_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- mod_mem_cache.c	10 Jun 2002 18:27:13 -0000	1.69
  +++ mod_mem_cache.c	10 Jun 2002 21:10:08 -0000	1.70
  @@ -98,7 +98,13 @@
       apr_os_file_t fd;
       long priority;      /**< the priority of this entry */
       long total_refs;          /**< total number of references this entry has had */
  -    apr_ssize_t pos;    /**< the position of this entry in the cache */
  +
  +#ifdef USE_ATOMICS
  +    apr_atomic_t pos;   /**< the position of this entry in the cache */
  +#else
  +    apr_ssize_t pos;
  +#endif
  +
   } mem_cache_object_t;
   
   typedef struct {
  @@ -137,12 +143,7 @@
       cache_object_t *obj = (cache_object_t *)a;
       mem_cache_object_t *mobj = obj->vobj;
   
  -#ifdef USE_ATOMICS
  -    return  (long)apr_atomic_read(&mobj->priority);
  -#else
       return  mobj->priority;
  -#endif
  -    
   }
   
   static void memcache_inc_frequency(void*a)
  
  
  

Mime
View raw message