是否AtomicReference.compareAndSet(old,new)保证
old.field没有改变吗?- 或者它只是保证
old没有重新分配给新对象?
如果 2 为真,是否意味着AtomicReference仅对不可变对象有用String?(因为在更改的可变性的情况old下成功old.field丢失) compareAndSet
是否AtomicReference.compareAndSet(old,new)保证
old.field没有改变吗?old没有重新分配给新对象?如果 2 为真,是否意味着AtomicReference仅对不可变对象有用String?(因为在更改的可变性的情况old下成功old.field丢失) compareAndSet