apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: [PATCH] fix apr_atomic.h for FreeBSD
Date Fri, 04 Apr 2003 14:57:54 GMT
Craig Rodrigues wrote:

> Index: apr_atomic.h
> ===================================================================
> RCS file: /home/cvspublic/apr/include/apr_atomic.h,v
> retrieving revision 1.47
> diff -u -r1.47 apr_atomic.h
> --- apr_atomic.h	5 Mar 2003 21:22:25 -0000	1.47
> +++ apr_atomic.h	26 Mar 2003 19:47:02 -0000
...
> +static APR_INLINE int apr_atomic_dec(volatile apr_atomic_t *mem) 
> +{
> +    apr_atomic_t x;
> +
> +    do {
> +      x = *mem;
> +    } while (atomic_cmpset_int(mem, x, x - 1) == 0); 

I can't find atomic_cmpset_int() on my FreeBSD 4.7 system.  Is this 
feature new with 5.0?

Maybe the real patch would see if this feature is available and, if so, 
use the code above, but otherwise use the generic mutex-based apr_atomic 
support.

I don't mind helping with the detection logic, but if you can research 
the issues related to atomic_cmpset_int() availability it would be helpful.


Mime
View raw message