語言

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

定義

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

[Android.Runtime.Register("compareAndExchange", "(IJJ)J", "", ApiSince=33)]
public long CompareAndExchange(int i, long expectedValue, long newValue);
[<Android.Runtime.Register("compareAndExchange", "(IJJ)J", "", ApiSince=33)>]
member this.CompareAndExchange : int * int64 * int64 -> int64

參數

i
Int32

指數

expectedValue
Int64

期望值

newValue
Int64

新值

傳回

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

屬性

備註

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

新增9。

Java 文件 java.util.concurrent.atomic.AtomicLongArray.compareAndExchange(int, long, long)

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

適用於