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

定义

以原子方式将索引处 i 的元素设置为 newValue 元素的当前值(称为 <em>见证值</em>), == expectedValue内存效果由指定 VarHandle#compareAndExchangeRelease

[Android.Runtime.Register("compareAndExchangeRelease", "(III)I", "", ApiSince=33)]
public int CompareAndExchangeRelease(int i, int expectedValue, int newValue);
[<Android.Runtime.Register("compareAndExchangeRelease", "(III)I", "", ApiSince=33)>]
member this.CompareAndExchangeRelease : int * int * int -> int

参数

i
Int32

索引

expectedValue
Int32

预期值

newValue
Int32

新值

返回

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

属性

注解

以原子方式将索引处 i 的元素设置为 newValue 元素的当前值(称为 <em>见证值</em>), == expectedValue内存效果由指定 VarHandle#compareAndExchangeRelease

已在 9 中添加。

Java文档java.util.concurrent.atomic.AtomicIntegerArray.compareAndExchangeRelease(int, int, int)

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

适用于