1818 |
|
|
1819 |
|
private static long fieldOffset(String fieldName) |
1820 |
|
throws NoSuchFieldException { |
1821 |
< |
return _unsafe.objectFieldOffset |
1821 |
> |
return UNSAFE.objectFieldOffset |
1822 |
|
(ForkJoinPool.class.getDeclaredField(fieldName)); |
1823 |
|
} |
1824 |
|
|
1825 |
< |
static final Unsafe _unsafe; |
1825 |
> |
static final Unsafe UNSAFE; |
1826 |
|
static final long eventCountOffset; |
1827 |
|
static final long workerCountsOffset; |
1828 |
|
static final long runControlOffset; |
1831 |
|
|
1832 |
|
static { |
1833 |
|
try { |
1834 |
< |
_unsafe = getUnsafe(); |
1834 |
> |
UNSAFE = getUnsafe(); |
1835 |
|
eventCountOffset = fieldOffset("eventCount"); |
1836 |
|
workerCountsOffset = fieldOffset("workerCounts"); |
1837 |
|
runControlOffset = fieldOffset("runControl"); |
1843 |
|
} |
1844 |
|
|
1845 |
|
private boolean casEventCount(long cmp, long val) { |
1846 |
< |
return _unsafe.compareAndSwapLong(this, eventCountOffset, cmp, val); |
1846 |
> |
return UNSAFE.compareAndSwapLong(this, eventCountOffset, cmp, val); |
1847 |
|
} |
1848 |
|
private boolean casWorkerCounts(int cmp, int val) { |
1849 |
< |
return _unsafe.compareAndSwapInt(this, workerCountsOffset, cmp, val); |
1849 |
> |
return UNSAFE.compareAndSwapInt(this, workerCountsOffset, cmp, val); |
1850 |
|
} |
1851 |
|
private boolean casRunControl(int cmp, int val) { |
1852 |
< |
return _unsafe.compareAndSwapInt(this, runControlOffset, cmp, val); |
1852 |
> |
return UNSAFE.compareAndSwapInt(this, runControlOffset, cmp, val); |
1853 |
|
} |
1854 |
|
private boolean casSpareStack(WaitQueueNode cmp, WaitQueueNode val) { |
1855 |
< |
return _unsafe.compareAndSwapObject(this, spareStackOffset, cmp, val); |
1855 |
> |
return UNSAFE.compareAndSwapObject(this, spareStackOffset, cmp, val); |
1856 |
|
} |
1857 |
|
private boolean casBarrierStack(WaitQueueNode cmp, WaitQueueNode val) { |
1858 |
< |
return _unsafe.compareAndSwapObject(this, syncStackOffset, cmp, val); |
1858 |
> |
return UNSAFE.compareAndSwapObject(this, syncStackOffset, cmp, val); |
1859 |
|
} |
1860 |
|
} |