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 Fri, 26 Sep 2003 02:34:10 GMT
brianp      2003/09/25 19:34:10

  Modified:    include  apr_atomic.h
  Log:
  Inline assembly version of apr_atomic_xchg32 for Linux/x86
  
  Revision  Changes    Path
  1.56      +8 -0      apr/include/apr_atomic.h
  
  Index: apr_atomic.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_atomic.h,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- apr_atomic.h	25 Sep 2003 14:49:00 -0000	1.55
  +++ apr_atomic.h	26 Sep 2003 02:34:10 -0000	1.56
  @@ -339,6 +339,14 @@
   #define apr_atomic_set32(mem, val)        apr_atomic_set(mem, val)
   #define apr_atomic_read32(mem)            apr_atomic_read(mem)
   
  +#define apr_atomic_xchg32(mem,val) \
  +({ apr_uint32_t prev = val; \
  +    asm volatile ("lock; xchgl %0, %1"              \
  +         : "=r" (prev)               \
  +         : "m" (*(mem)), "0"(prev) \
  +         : "memory"); \
  +    prev;})
  +
   /*#define apr_atomic_init(pool)        APR_SUCCESS*/
   
   #elif defined(__MVS__) /* OS/390 */
  
  
  

Mime
View raw message