1

Unsafe类功能之: 内存屏障

loadFence

loadFence() 表示该方法之前的所有load操作在内存屏障之前完成。
(Ensures lack of reordering of loads before the fence with loads or stores after the fence.)

public native void loadFence();

storeFence

storeFence()表示该方法之前的所有store操作在内存屏障之前完成。
(Ensures lack of reordering of stores before the fence with loads or stores after the fence.)

public native void storeFence();

fullFence

fullFence()表示该方法之前的所有load、store操作在内存屏障之前完成。
(Ensures lack of reordering of loads or stores before the fence with loads or stores after the fence.)

public native void fullFence();

丰木
322 声望19 粉丝

遇见超乎想象的自己!