Commit 7fac642a authored by Greg Ames's avatar Greg Ames
Browse files

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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95597 13f79535-47bb-0310-9956-ffa450edef68
parent 608a8034
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -98,7 +98,13 @@ typedef struct mem_cache_object {
    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 @@ static long memcache_get_priority(void*a)
    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)