You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by gr...@apache.org on 2002/03/19 23:42:30 UTC

cvs commit: apr/atomic/unix apr_atomic.c

gregames    02/03/19 14:42:30

  Modified:    atomic/unix apr_atomic.c
  Log:
  apr_atomic_dec:  change the fallback version to return the new value of
  the memory variable.
  
  Revision  Changes    Path
  1.11      +3 -3      apr/atomic/unix/apr_atomic.c
  
  Index: apr_atomic.c
  ===================================================================
  RCS file: /home/cvs/apr/atomic/unix/apr_atomic.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apr_atomic.c	16 Mar 2002 03:54:00 -0000	1.10
  +++ apr_atomic.c	19 Mar 2002 22:42:30 -0000	1.11
  @@ -126,13 +126,13 @@
   int apr_atomic_dec(volatile apr_atomic_t *mem) 
   {
       apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)];
  -    apr_uint32_t prev;
  +    apr_uint32_t new;
   
       if (apr_thread_mutex_lock(lock) == APR_SUCCESS) {
  -        prev = *mem;
           (*mem)--;
  +        new = *mem;
           apr_thread_mutex_unlock(lock);
  -        return prev; 
  +        return new; 
       }
       return *mem; 
   }