### Eclipse Workspace Patch 1.0 #P HEAD Index: modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java =================================================================== --- modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java (revision 793515) +++ modules/concurrent/src/main/java/java/util/concurrent/atomic/AtomicLong.java (working copy) @@ -32,8 +32,10 @@ * CompareAndSet for longs. While the unsafe.CompareAndSetLong * 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;