AtomicReferenceArray.UpdateAndGet(Int32, IUnaryOperator) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
以原子方式更新(以記憶體效果指定) VarHandle#compareAndSet的索引元素 i ,並回傳更新後的值。
[Android.Runtime.Register("updateAndGet", "(ILjava/util/function/UnaryOperator;)Ljava/lang/Object;", "", ApiSince=24)]
public Java.Lang.Object? UpdateAndGet(int i, Java.Util.Functions.IUnaryOperator? updateFunction);
[<Android.Runtime.Register("updateAndGet", "(ILjava/util/function/UnaryOperator;)Ljava/lang/Object;", "", ApiSince=24)>]
member this.UpdateAndGet : int * Java.Util.Functions.IUnaryOperator -> Java.Lang.Object
參數
- i
- Int32
指數
- updateFunction
- IUnaryOperator
一個無副作用函數
傳回
更新後的數值
- 屬性
備註
以原子方式更新(以記憶體效果指定) VarHandle#compareAndSet的索引元素 i ,並回傳更新後的值。 此函式應無副作用,因為當嘗試更新因執行緒間爭用失敗時,可重新套用此功能。
新增於1.8版本。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。