AtomicLong.CompareAndExchangeAcquire(Int64, Int64) 方法

定义

以原子方式将值设置为 newValue 当前值(称为 <em>见证值</em>)时, == expectedValue其内存效果由指定 VarHandle#compareAndExchangeAcquire

[Android.Runtime.Register("compareAndExchangeAcquire", "(JJ)J", "", ApiSince=33)]
public long CompareAndExchangeAcquire(long expectedValue, long newValue);
[<Android.Runtime.Register("compareAndExchangeAcquire", "(JJ)J", "", ApiSince=33)>]
member this.CompareAndExchangeAcquire : int64 * int64 -> int64

参数

expectedValue
Int64

预期值

newValue
Int64

新值

返回

<em>见证值</em>,如果成功,它将与预期值相同

属性

注解

以原子方式将值设置为 newValue 当前值(称为 <em>见证值</em>)时, == expectedValue其内存效果由指定 VarHandle#compareAndExchangeAcquire

已在 9 中添加。

Java文档java.util.concurrent.atomic.AtomicLong.compareAndExchangeAcquire(long, long)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于