- Found in:
- JContainers
intfunctioncompareExchangeInt(intobject, stringpath, intdesired, intexpected, boolcreateMissingKeys=false, intonErrorReturn=0)NativeGlobal
Description
Documentation Comment
Compares the value at the @path with the @expected and, if they are equal, exchanges the value at the @path with the @desired values.
Returns previous value.
Caveats
Parameters
intobject
stringpath
intdesired
intexpected
boolcreateMissingKeys=false
intonErrorReturn=0
Examples
Auto-Generated Example
int myInt__object
string myString__path
int myInt__desired
int myInt__expected
bool myBool__createMissingKeys
int myInt__onErrorReturn
int returnedValue = JAtomic.compareExchangeInt(myInt__object, myString__path, myInt__desired, myInt__expected, myBool__createMissingKeys, myInt__onErrorReturn)