apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: apr/include apr_atomic.h
Date Sun, 14 Sep 2003 01:59:54 GMT
brianp      2003/09/13 18:59:54

  Modified:    include  apr_atomic.h
  Log:
  more efficient implementation of atomic add on x86
  
  Revision  Changes    Path
  1.51      +4 -5      apr/include/apr_atomic.h
  
  Index: apr_atomic.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_atomic.h,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- apr_atomic.h	14 Sep 2003 01:13:13 -0000	1.50
  +++ apr_atomic.h	14 Sep 2003 01:59:54 -0000	1.51
  @@ -223,11 +223,10 @@
       prev;})
   
   #define apr_atomic_add(mem, val)                                \
  -({ register apr_atomic_t last;                                  \
  -   do {                                                         \
  -       last = *(mem);                                           \
  -   } while (apr_atomic_cas((mem), last + (val), last) != last); \
  -  })
  + asm volatile ("lock; addl %1, %0"                              \
  +    :                                                           \
  +    : "m" (*(mem)), "r" (val)                                   \
  +    : "memory")
   
   #define apr_atomic_dec(mem)                                     \
   ({ register apr_atomic_t last;                                  \
  
  
  

Mime
View raw message