在研究jdk源代码(jdk 1.8.0_111)时,我发现了一段奇怪的代码如下:
public class AtmicBoolean implements Serializable {
private static final long serialVersionUID = 4654671469794556979L;
private static final Unsafe unsafe = ;
private static final long valueOffset;
private volatile int value;
static {
try {
valueOffset = unsafe.objectFieldOffset(AtomicBoolean.class.getDeclaredField("value"));
} catch (Exception localException) {
throw new Error(localException);
}
}
// .... other codes
}
问题: unsafe 变量在哪里设置?