Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 19779 invoked from network); 21 Jul 2009 13:22:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jul 2009 13:22:33 -0000 Received: (qmail 74105 invoked by uid 500); 21 Jul 2009 13:23:38 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 74082 invoked by uid 500); 21 Jul 2009 13:23:38 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 74073 invoked by uid 99); 21 Jul 2009 13:23:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 13:23:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Tue, 21 Jul 2009 13:23:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B165C23888D0; Tue, 21 Jul 2009 13:23:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r796290 - /harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java Date: Tue, 21 Jul 2009 13:23:16 -0000 To: commits@harmony.apache.org From: hindessm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090721132316.B165C23888D0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hindessm Date: Tue Jul 21 13:23:16 2009 New Revision: 796290 URL: http://svn.apache.org/viewvc?rev=796290&view=rev Log: Manually applied patch from "[#HARMONY-6280] [classlib][concurrent] AtomicLong class fails with UnsatisfiedLinkError missing VMSupportsCS8". Modified: harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java Modified: harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java?rev=796290&r1=796289&r2=796290&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java (original) +++ harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java Tue Jul 21 13:23:16 2009 @@ -32,8 +32,10 @@ * compareAndSwap for longs. While the Unsafe.compareAndSwapLong * method works in either case, some constructions should be * handled at Java level to avoid locking user-visible locks. + * + * Initialised in the static block. */ - static final boolean VM_SUPPORTS_LONG_CAS = VMSupportsCS8(); + static final boolean VM_SUPPORTS_LONG_CAS; /** * Returns whether underlying JVM supports lockless CompareAndSet @@ -46,6 +48,15 @@ valueOffset = unsafe.objectFieldOffset (AtomicLong.class.getDeclaredField("value")); } catch (Exception ex) { throw new Error(ex); } + + boolean longCASSupport; + try { + longCASSupport = VMSupportsCS8(); + } catch (UnsatisfiedLinkError e) { + // assume there's support if the native isn't provided by the VM + longCASSupport = true; + } + VM_SUPPORTS_LONG_CAS = longCASSupport; } private volatile long value;