public class FieldReference extends Object
Unsafe class.| Modifier and Type | Field and Description |
|---|---|
(package private) long |
fieldAddress |
(package private) Object |
target |
(package private) static sun.misc.Unsafe |
unsafe |
| Constructor and Description |
|---|
FieldReference() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
compareAndSet(int expect,
int update)
Atomically sets the value to the given updated value
if the current value
== the expected value. |
<T> boolean |
compareAndSet(T expect,
T update) |
static long |
getFieldAddress(Class<?> clazz,
String fieldName) |
static sun.misc.Unsafe |
getUnsafe() |
static FieldReference |
wrap(Object object,
String fieldName) |
static final sun.misc.Unsafe unsafe
final Object target
final long fieldAddress
public static sun.misc.Unsafe getUnsafe()
public static FieldReference wrap(Object object, String fieldName)
public final boolean compareAndSet(int expect,
int update)
== the expected value.expect - the expected valueupdate - the new valuepublic final <T> boolean compareAndSet(T expect,
T update)
Copyright © 2015. All rights reserved.