AtomicIntegerArray.CompareAndSet(Int32, Int32, Int32) 方法

定义

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

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

参数

i
Int32

索引

expectedValue
Int32

预期值

newValue
Int32

新值

返回

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

属性

注解

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

适用于 . 的 java.util.concurrent.atomic.AtomicIntegerArray.compareAndSet(int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于