--- jsr166/src/jsr166y/Phaser.java 2009/07/21 00:15:14 1.14 +++ jsr166/src/jsr166y/Phaser.java 2009/07/22 01:36:51 1.16 @@ -175,6 +175,9 @@ import java.lang.reflect.*; * parties result in IllegalStateExceptions. However, you can and * should create tiered phasers to accommodate arbitrarily large sets * of participants. + * + * @since 1.7 + * @author Doug Lea */ public class Phaser { /* @@ -953,16 +956,16 @@ public class Phaser { private static long fieldOffset(String fieldName) throws NoSuchFieldException { - return _unsafe.objectFieldOffset + return UNSAFE.objectFieldOffset (Phaser.class.getDeclaredField(fieldName)); } - static final Unsafe _unsafe; + static final Unsafe UNSAFE; static final long stateOffset; static { try { - _unsafe = getUnsafe(); + UNSAFE = getUnsafe(); stateOffset = fieldOffset("state"); } catch (Throwable e) { throw new RuntimeException("Could not initialize intrinsics", e); @@ -970,6 +973,6 @@ public class Phaser { } final boolean casState(long cmp, long val) { - return _unsafe.compareAndSwapLong(this, stateOffset, cmp, val); + return UNSAFE.compareAndSwapLong(this, stateOffset, cmp, val); } }