語言

AtomicBoolean.WeakCompareAndSetPlain(Boolean, Boolean) 方法

定義

可能原子上將值設定為 newValue 當前值 == expectedValue,並以記憶體效應 VarHandle#weakCompareAndSetPlain指定。

[Android.Runtime.Register("weakCompareAndSetPlain", "(ZZ)Z", "GetWeakCompareAndSetPlain_ZZHandler", ApiSince=33)]
public virtual bool WeakCompareAndSetPlain(bool expectedValue, bool newValue);
[<Android.Runtime.Register("weakCompareAndSetPlain", "(ZZ)Z", "GetWeakCompareAndSetPlain_ZZHandler", ApiSince=33)>]
abstract member WeakCompareAndSetPlain : bool * bool -> bool
override this.WeakCompareAndSetPlain : bool * bool -> bool

參數

expectedValue
Boolean

期望值

newValue
Boolean

新值

傳回

true 若成功

屬性

備註

可能原子上將值設定為 newValue 當前值 == expectedValue,並以記憶體效應 VarHandle#weakCompareAndSetPlain指定。

新增9。

java.util.concurrent.atomic.AtomicBoolean.weakCompareAndSetPlain(boolean, boolean)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於