Partager via


AtomicLongFieldUpdater.GetAndSet(Object, Int64) 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;J)J", "GetGetAndSet_Ljava_lang_Object_JHandler")]
public virtual long GetAndSet (Java.Lang.Object? obj, long newValue);
[<Android.Runtime.Register("getAndSet", "(Ljava/lang/Object;J)J", "GetGetAndSet_Ljava_lang_Object_JHandler")>]
abstract member GetAndSet : Java.Lang.Object * int64 -> int64
override this.GetAndSet : Java.Lang.Object * int64 -> int64

Parameters

obj
Object

An object whose field to get and set

newValue
Int64

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.AtomicLongFieldUpdater.getAndSet(T, long).

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