語言

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

定義

原子方式將索引 i 設定為, newValue 若元素目前值(稱為 見證值) == expectedValue為 ,且記憶體效果由 指定 VarHandle#compareAndExchangeAcquire。

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

參數

i
Int32

指數

expectedValue
Int32

期望值

newValue
Int32

新值

傳回

見證值,若成功,則與期望值相同

屬性

備註

原子方式將索引 i 設定為, newValue 若元素目前值(稱為 見證值) == expectedValue為 ,且記憶體效果由 指定 VarHandle#compareAndExchangeAcquire。

新增9。

Java 文件 java.util.concurrent.atomic.AtomicIntegerArray.compareAndExchangeAcquire(int, int, int)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於