Share via


AtomicIntegerFieldUpdater.GetAndSet(Object, Int32) Method

Definition

Atomically sets the field of the given object managed by this updater to the given value and returns the old value.

[Android.Runtime.Register("getAndSet", "(Ljava/lang/Object;I)I", "GetGetAndSet_Ljava_lang_Object_IHandler")]
public virtual int GetAndSet (Java.Lang.Object? obj, int newValue);
[<Android.Runtime.Register("getAndSet", "(Ljava/lang/Object;I)I", "GetGetAndSet_Ljava_lang_Object_IHandler")>]
abstract member GetAndSet : Java.Lang.Object * int -> int
override this.GetAndSet : Java.Lang.Object * int -> int

Parameters

obj
Object

An object whose field to get and set

newValue
Int32

the new value

Returns

the previous value

Attributes

Remarks

Atomically sets the field of the given object managed by this updater to the given value and returns the old value.

Java documentation for java.util.concurrent.atomic.AtomicIntegerFieldUpdater.getAndSet(T, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to