Return-Path: Delivered-To: apmail-apr-cvs-archive@www.apache.org Received: (qmail 51050 invoked from network); 13 Sep 2003 05:05:13 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Sep 2003 05:05:13 -0000 Received: (qmail 56431 invoked by uid 500); 13 Sep 2003 05:04:52 -0000 Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 56390 invoked by uid 500); 13 Sep 2003 05:04:51 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 56374 invoked from network); 13 Sep 2003 05:04:51 -0000 Date: 13 Sep 2003 05:05:11 -0000 Message-ID: <20030913050511.51019.qmail@minotaur.apache.org> From: brianp@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/include apr_atomic.h X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N brianp 2003/09/12 22:05:11 Modified: include apr_atomic.h Log: Faster code for apr_atomic_inc on x86 Revision Changes Path 1.49 +4 -5 apr/include/apr_atomic.h Index: apr_atomic.h =================================================================== RCS file: /home/cvs/apr/include/apr_atomic.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- apr_atomic.h 3 May 2003 04:11:07 -0000 1.48 +++ apr_atomic.h 13 Sep 2003 05:05:11 -0000 1.49 @@ -237,11 +237,10 @@ (--last != 0); }) #define apr_atomic_inc(mem) \ -({ register apr_atomic_t last; \ - do { \ - last = *(mem); \ - } while (apr_atomic_cas((mem), last + 1, last) != last); \ - }) + asm volatile ("lock; incl %0" \ + : \ + : "m" (*(mem)) \ + : "memory"); #define apr_atomic_set(mem, val) (*(mem) = val) #define apr_atomic_read(mem) (*(mem))