AtomicLongArray.CompareAndSet(Int32, Int64, Int64) 方法

定义

以原子方式将索引处i的元素设置为newValue元素的当前值== expectedValue(内存效果由指定)。VarHandle#compareAndSet

[Android.Runtime.Register("compareAndSet", "(IJJ)Z", "")]
public bool CompareAndSet(int i, long expectedValue, long newValue);
[<Android.Runtime.Register("compareAndSet", "(IJJ)Z", "")>]
member this.CompareAndSet : int * int64 * int64 -> bool

参数

i
Int32

索引

expectedValue
Int64

预期值

newValue
Int64

新值

返回

true 如果成功,则为 。 False 返回指示实际值不等于预期值。

属性

注解

以原子方式将索引处i的元素设置为newValue元素的当前值== expectedValue(内存效果由指定)。VarHandle#compareAndSet

Java文档java.util.concurrent.atomic.AtomicLongArray.compareAndSet(int, long, long)

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

适用于