語言

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

定義

若元素的當前值(稱為 em witness value</em>)== expectedValue為 ,則原子上將該元素的索引i設為 ,newValue並有記憶效果,由 指定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

新值

傳回

<EM>見證值</EM>,若成功則與期望值相同

屬性

備註

若元素的當前值(稱為 em witness value</em>)== expectedValue為 ,則原子上將該元素的索引i設為 ,newValue並有記憶效果,由 指定VarHandle#compareAndExchangeAcquire。><

新增9。

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

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

適用於