Language

VarHandle.GetAndAddAcquire(Object[]) Method

Definition

Atomically adds the value to the current value of a variable with the memory semantics of set(java.lang.Object...), and returns the variable's previous value, as accessed with the memory semantics of getAcquire(java.lang.Object...).

[Android.Runtime.Register("getAndAddAcquire", "([Ljava/lang/Object;)Ljava/lang/Object;", "", ApiSince=33)]
public Java.Lang.Object? GetAndAddAcquire(params Java.Lang.Object[]? args);
[<Android.Runtime.Register("getAndAddAcquire", "([Ljava/lang/Object;)Ljava/lang/Object;", "", ApiSince=33)>]
member this.GetAndAddAcquire : Java.Lang.Object[] -> Java.Lang.Object

Parameters

args
Object[]

the signature-polymorphic parameter list of the form (CT1 ct1,..., CTn ctn, T value), statically represented using varargs.

Returns

the signature-polymorphic result that is the previous value of the variable, statically represented using Object.

Attributes

Remarks

Atomically adds the value to the current value of a variable with the memory semantics of set(java.lang.Object...), and returns the variable's previous value, as accessed with the memory semantics of getAcquire(java.lang.Object...). The method signature is of the form (CT1 ct1,..., CTn ctn, T value)T. The symbolic type descriptor at the call site of getAndAddAcquire must match the access mode type that is the result of calling accessModeType(VarHandle.AccessMode.GET_AND_ADD_ACQUIRE) on this VarHandle.

Java reference for java.lang.invoke.VarHandle.getAndAddAcquire.

Applies to