162 |
|
} |
163 |
|
|
164 |
|
final boolean casStatus(int cmp, int val) { |
165 |
< |
return _unsafe.compareAndSwapInt(this, statusOffset, cmp, val); |
165 |
> |
return UNSAFE.compareAndSwapInt(this, statusOffset, cmp, val); |
166 |
|
} |
167 |
|
|
168 |
|
/** |
170 |
|
*/ |
171 |
|
static void rethrowException(Throwable ex) { |
172 |
|
if (ex != null) |
173 |
< |
_unsafe.throwException(ex); |
173 |
> |
UNSAFE.throwException(ex); |
174 |
|
} |
175 |
|
|
176 |
|
// Setting completion status |
213 |
|
final void setNormalCompletion() { |
214 |
|
// Try typical fast case -- single CAS, no signal, not already done. |
215 |
|
// Manually expand casStatus to improve chances of inlining it |
216 |
< |
if (!_unsafe.compareAndSwapInt(this, statusOffset, 0, NORMAL)) |
216 |
> |
if (!UNSAFE.compareAndSwapInt(this, statusOffset, 0, NORMAL)) |
217 |
|
setCompletion(NORMAL); |
218 |
|
} |
219 |
|
|
1053 |
|
|
1054 |
|
private static long fieldOffset(String fieldName) |
1055 |
|
throws NoSuchFieldException { |
1056 |
< |
return _unsafe.objectFieldOffset |
1056 |
> |
return UNSAFE.objectFieldOffset |
1057 |
|
(ForkJoinTask.class.getDeclaredField(fieldName)); |
1058 |
|
} |
1059 |
|
|
1060 |
< |
static final Unsafe _unsafe; |
1060 |
> |
static final Unsafe UNSAFE; |
1061 |
|
static final long statusOffset; |
1062 |
|
|
1063 |
|
static { |
1064 |
|
try { |
1065 |
< |
_unsafe = getUnsafe(); |
1065 |
> |
UNSAFE = getUnsafe(); |
1066 |
|
statusOffset = fieldOffset("status"); |
1067 |
|
} catch (Throwable e) { |
1068 |
|
throw new RuntimeException("Could not initialize intrinsics", e); |