httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Ames <grega...@remulak.net>
Subject Re: [PATCH] Re: Seg fault: race conditions in mod_mem_cache.c
Date Thu, 16 Sep 2004 14:59:19 GMT
looks good.

Bill Stoddard wrote:

>  static int remove_url(const char *key) 

[...]

> -        if (obj) {
> -            obj->cleanup = 1;
> +        if (!apr_atomic_dec(&obj->refcount)) {
> +            /* For performance, cleanup cache object after releasing the lock */
> +            cleanup = 1;

this could be:

       cleanup = !apr_atomic_dec(&obj->refcount);

might save a conditional branch.  Is it as clear?  IMO yes, because you have to 
understand what !apr_atomic_dec() means either way.  no strong opinion.

Greg


Mime
View raw message