語言

AtomicLong.CompareAndExchange(Int64, Int64) 方法

定義

原子設定值為 ,newValue若當前值稱為 em>witness value</em>,== expectedValue且記憶體<效果依 所指定VarHandle#compareAndExchange。

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

參數

expectedValue
Int64

期望值

newValue
Int64

新值

傳回

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

屬性

備註

原子設定值為 ,newValue若當前值稱為 em>witness value</em>,== expectedValue且記憶體<效果依 所指定VarHandle#compareAndExchange。

新增9。

Java 文件 java.util.concurrent.atomic.AtomicLong.compareAndExchange(long, long)。

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

適用於