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();
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。