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

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

# Line 56 | Line 56 | import java.lang.reflect.*;
56   * maximum number of running threads to 32767. Attempts to create
57   * pools with greater than the maximum result in
58   * IllegalArgumentExceptions.
59 + *
60 + * @since 1.7
61 + * @author Doug Lea
62   */
63   public class ForkJoinPool extends AbstractExecutorService {
64  
# Line 1818 | Line 1821 | public class ForkJoinPool extends Abstra
1821  
1822      private static long fieldOffset(String fieldName)
1823              throws NoSuchFieldException {
1824 <        return _unsafe.objectFieldOffset
1824 >        return UNSAFE.objectFieldOffset
1825              (ForkJoinPool.class.getDeclaredField(fieldName));
1826      }
1827  
1828 <    static final Unsafe _unsafe;
1828 >    static final Unsafe UNSAFE;
1829      static final long eventCountOffset;
1830      static final long workerCountsOffset;
1831      static final long runControlOffset;
# Line 1831 | Line 1834 | public class ForkJoinPool extends Abstra
1834  
1835      static {
1836          try {
1837 <            _unsafe = getUnsafe();
1837 >            UNSAFE = getUnsafe();
1838              eventCountOffset = fieldOffset("eventCount");
1839              workerCountsOffset = fieldOffset("workerCounts");
1840              runControlOffset = fieldOffset("runControl");
# Line 1843 | Line 1846 | public class ForkJoinPool extends Abstra
1846      }
1847  
1848      private boolean casEventCount(long cmp, long val) {
1849 <        return _unsafe.compareAndSwapLong(this, eventCountOffset, cmp, val);
1849 >        return UNSAFE.compareAndSwapLong(this, eventCountOffset, cmp, val);
1850      }
1851      private boolean casWorkerCounts(int cmp, int val) {
1852 <        return _unsafe.compareAndSwapInt(this, workerCountsOffset, cmp, val);
1852 >        return UNSAFE.compareAndSwapInt(this, workerCountsOffset, cmp, val);
1853      }
1854      private boolean casRunControl(int cmp, int val) {
1855 <        return _unsafe.compareAndSwapInt(this, runControlOffset, cmp, val);
1855 >        return UNSAFE.compareAndSwapInt(this, runControlOffset, cmp, val);
1856      }
1857      private boolean casSpareStack(WaitQueueNode cmp, WaitQueueNode val) {
1858 <        return _unsafe.compareAndSwapObject(this, spareStackOffset, cmp, val);
1858 >        return UNSAFE.compareAndSwapObject(this, spareStackOffset, cmp, val);
1859      }
1860      private boolean casBarrierStack(WaitQueueNode cmp, WaitQueueNode val) {
1861 <        return _unsafe.compareAndSwapObject(this, syncStackOffset, cmp, val);
1861 >        return UNSAFE.compareAndSwapObject(this, syncStackOffset, cmp, val);
1862      }
1863   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines