858 /**
859 * Atomically update Java variable to <tt>x</tt> if it is currently
860 * holding <tt>expected</tt>.
861 * @return <tt>true</tt> if successful
862 */
863 public final native boolean compareAndSwapObject(Object o, long offset,
864 Object expected,
865 Object x);
866
对象O的l位置的数据如果等于expected则用x覆盖此位置的值,并且返回true
不等于expected 怎返回false
sun.misc.Unsafe 笔记
最新推荐文章于 2021-04-20 10:40:55 发布