ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/Phaser.java
(Generate patch)

Comparing jsr166/src/jsr166y/Phaser.java (file contents):
Revision 1.14 by jsr166, Tue Jul 21 00:15:14 2009 UTC vs.
Revision 1.16 by jsr166, Wed Jul 22 01:36:51 2009 UTC

# Line 175 | Line 175 | import java.lang.reflect.*;
175   * parties result in IllegalStateExceptions. However, you can and
176   * should create tiered phasers to accommodate arbitrarily large sets
177   * of participants.
178 + *
179 + * @since 1.7
180 + * @author Doug Lea
181   */
182   public class Phaser {
183      /*
# Line 953 | Line 956 | public class Phaser {
956  
957      private static long fieldOffset(String fieldName)
958              throws NoSuchFieldException {
959 <        return _unsafe.objectFieldOffset
959 >        return UNSAFE.objectFieldOffset
960              (Phaser.class.getDeclaredField(fieldName));
961      }
962  
963 <    static final Unsafe _unsafe;
963 >    static final Unsafe UNSAFE;
964      static final long stateOffset;
965  
966      static {
967          try {
968 <            _unsafe = getUnsafe();
968 >            UNSAFE = getUnsafe();
969              stateOffset = fieldOffset("state");
970          } catch (Throwable e) {
971              throw new RuntimeException("Could not initialize intrinsics", e);
# Line 970 | Line 973 | public class Phaser {
973      }
974  
975      final boolean casState(long cmp, long val) {
976 <        return _unsafe.compareAndSwapLong(this, stateOffset, cmp, val);
976 >        return UNSAFE.compareAndSwapLong(this, stateOffset, cmp, val);
977      }
978   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines