Return-Path: X-Original-To: apmail-zookeeper-commits-archive@www.apache.org Delivered-To: apmail-zookeeper-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3B5F9966 for ; Mon, 6 Feb 2012 09:55:08 +0000 (UTC) Received: (qmail 13006 invoked by uid 500); 6 Feb 2012 09:55:08 -0000 Delivered-To: apmail-zookeeper-commits-archive@zookeeper.apache.org Received: (qmail 12920 invoked by uid 500); 6 Feb 2012 09:55:02 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 12895 invoked by uid 99); 6 Feb 2012 09:54:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 09:54:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 09:54:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4AAA02388860 for ; Mon, 6 Feb 2012 09:54:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1240953 - in /zookeeper/branches/branch-3.4: CHANGES.txt src/c/tests/ThreadingUtil.cc Date: Mon, 06 Feb 2012 09:54:35 -0000 To: commits@zookeeper.apache.org From: mahadev@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120206095435.4AAA02388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mahadev Date: Mon Feb 6 09:54:34 2012 New Revision: 1240953 URL: http://svn.apache.org/viewvc?rev=1240953&view=rev Log: ZOOKEEPER-1374. C client multi-threaded test suite fails to compile on ARM architectures. (James Page via mahadev) Modified: zookeeper/branches/branch-3.4/CHANGES.txt zookeeper/branches/branch-3.4/src/c/tests/ThreadingUtil.cc Modified: zookeeper/branches/branch-3.4/CHANGES.txt URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/CHANGES.txt?rev=1240953&r1=1240952&r2=1240953&view=diff ============================================================================== --- zookeeper/branches/branch-3.4/CHANGES.txt (original) +++ zookeeper/branches/branch-3.4/CHANGES.txt Mon Feb 6 09:54:34 2012 @@ -38,6 +38,9 @@ BUGFIXES: ZOOKEEPER-1340. multi problem - typical user operations are generating ERROR level messages in the server (phunt via mahadev) + ZOOKEEPER-1374. C client multi-threaded test suite fails to + compile on ARM architectures. (James Page via mahadev) + IMPROVEMENTS: ZOOKEEPER-1322. Cleanup/fix logging in Quorum code. (phunt via mahadev) Modified: zookeeper/branches/branch-3.4/src/c/tests/ThreadingUtil.cc URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/c/tests/ThreadingUtil.cc?rev=1240953&r1=1240952&r2=1240953&view=diff ============================================================================== --- zookeeper/branches/branch-3.4/src/c/tests/ThreadingUtil.cc (original) +++ zookeeper/branches/branch-3.4/src/c/tests/ThreadingUtil.cc Mon Feb 6 09:54:34 2012 @@ -47,6 +47,9 @@ void Mutex::release() { // Atomics int32_t atomic_post_incr(volatile int32_t* operand, int32_t incr) { +#if defined(__GNUC__) + return __sync_fetch_and_add(operand,incr); +#else int32_t result; __asm__ __volatile__( "lock xaddl %0,%1\n" @@ -54,15 +57,20 @@ int32_t atomic_post_incr(volatile int32_ : "0"(incr) : "memory"); return result; +#endif } int32_t atomic_fetch_store(volatile int32_t *ptr, int32_t value) { +#if defined(__GNUC__) + return __sync_lock_test_and_set(ptr,value); +#else int32_t result; __asm__ __volatile__("lock xchgl %0,%1\n" : "=r"(result), "=m"(*ptr) : "0"(value) : "memory"); return result; +#endif } #else int32_t atomic_post_incr(volatile int32_t* operand, int32_t incr){