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

Comparing jsr166/src/jsr166y/ForkJoinTask.java (file contents):
Revision 1.10 by jsr166, Tue Jul 21 00:15:13 2009 UTC vs.
Revision 1.12 by jsr166, Wed Jul 22 01:36:51 2009 UTC

# Line 107 | Line 107 | import java.lang.reflect.*;
107   * in general sensible to serialize tasks only before or after, but
108   * not during execution. Serialization is not relied on during
109   * execution itself.
110 + *
111 + * @since 1.7
112 + * @author Doug Lea
113   */
114   public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
115  
# Line 162 | Line 165 | public abstract class ForkJoinTask<V> im
165      }
166  
167      final boolean casStatus(int cmp, int val) {
168 <        return _unsafe.compareAndSwapInt(this, statusOffset, cmp, val);
168 >        return UNSAFE.compareAndSwapInt(this, statusOffset, cmp, val);
169      }
170  
171      /**
# Line 170 | Line 173 | public abstract class ForkJoinTask<V> im
173       */
174      static void rethrowException(Throwable ex) {
175          if (ex != null)
176 <            _unsafe.throwException(ex);
176 >            UNSAFE.throwException(ex);
177      }
178  
179      // Setting completion status
# Line 213 | Line 216 | public abstract class ForkJoinTask<V> im
216      final void setNormalCompletion() {
217          // Try typical fast case -- single CAS, no signal, not already done.
218          // Manually expand casStatus to improve chances of inlining it
219 <        if (!_unsafe.compareAndSwapInt(this, statusOffset, 0, NORMAL))
219 >        if (!UNSAFE.compareAndSwapInt(this, statusOffset, 0, NORMAL))
220              setCompletion(NORMAL);
221      }
222  
# Line 1053 | Line 1056 | public abstract class ForkJoinTask<V> im
1056  
1057      private static long fieldOffset(String fieldName)
1058              throws NoSuchFieldException {
1059 <        return _unsafe.objectFieldOffset
1059 >        return UNSAFE.objectFieldOffset
1060              (ForkJoinTask.class.getDeclaredField(fieldName));
1061      }
1062  
1063 <    static final Unsafe _unsafe;
1063 >    static final Unsafe UNSAFE;
1064      static final long statusOffset;
1065  
1066      static {
1067          try {
1068 <            _unsafe = getUnsafe();
1068 >            UNSAFE = getUnsafe();
1069              statusOffset = fieldOffset("status");
1070          } catch (Throwable e) {
1071              throw new RuntimeException("Could not initialize intrinsics", e);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines