apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr/atomic/netware apr_atomic.c
Date Mon, 08 Dec 2003 21:44:31 GMT
bnicholes    2003/12/08 13:44:31

  Modified:    atomic/netware apr_atomic.c
  Log:
  Switch to a pure atomic implementation
  
  Revision  Changes    Path
  1.9       +2 -6      apr/atomic/netware/apr_atomic.c
  
  Index: apr_atomic.c
  ===================================================================
  RCS file: /home/cvs/apr/atomic/netware/apr_atomic.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apr_atomic.c	4 Dec 2003 21:44:33 -0000	1.8
  +++ apr_atomic.c	8 Dec 2003 21:44:31 -0000	1.9
  @@ -64,9 +64,7 @@
   
   APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val)
   {
  -    apr_uint32_t old = *mem;
  -    atomic_add((unsigned long *)mem,(unsigned long)val);
  -    return old;
  +    return atomic_xchgadd((unsigned long *)mem,(unsigned long)val);
   }
   
   APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val)
  @@ -76,9 +74,7 @@
   
   APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem)
   {
  -    apr_uint32_t old = *mem;
  -    atomic_inc((unsigned long *)mem);
  -    return old;
  +    return atomic_xchgadd((unsigned long *)mem, 1);
   }
   
   APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val)
  
  
  

Mime
View raw message