public class Synchronization extends Object
Constructor and Description |
---|
Synchronization() |
Modifier and Type | Method and Description |
---|---|
static int |
fetchAndAdd(Object base,
Offset offset,
int increment) |
static Address |
fetchAndAddAddressWithBound(Object base,
Offset offset,
int increment,
Address bound) |
static int |
fetchAndDecrement(Object base,
Offset offset,
int decrement) |
static int |
fetchAndStore(Object base,
Offset offset,
int newValue) |
static Address |
fetchAndStoreAddress(Object base,
Offset offset,
Address newValue) |
static Address |
fetchAndSubAddressWithBound(Object base,
Offset offset,
int decrement,
Address bound) |
static boolean |
testAndSet(Object base,
Offset offset,
int newValue) |
static boolean |
tryCompareAndSwap(Object base,
Offset offset,
Address testValue,
Address newValue)
Atomically swap test value to new value in the specified object and the specified field
|
static boolean |
tryCompareAndSwap(Object base,
Offset offset,
int testValue,
int newValue)
Atomically swap test value to new value in the specified object and the specified field
|
static boolean |
tryCompareAndSwap(Object base,
Offset offset,
long testValue,
long newValue)
Atomically swap test value to new value in the specified object and the specified field
|
static boolean |
tryCompareAndSwap(Object base,
Offset offset,
Object testValue,
Object newValue)
Atomically swap test value to new value in the specified object and the specified field
|
static boolean |
tryCompareAndSwap(Object base,
Offset offset,
Word testValue,
Word newValue)
Atomically swap test value to new value in the specified object and the specified field
|
public Synchronization()
public static boolean tryCompareAndSwap(Object base, Offset offset, int testValue, int newValue)
base
- object containing fieldoffset
- position of fieldtestValue
- expected value of fieldnewValue
- new value of fieldtrue
=> successful swap, false
=> field not equal to testValuepublic static boolean tryCompareAndSwap(Object base, Offset offset, long testValue, long newValue)
base
- object containing fieldoffset
- position of fieldtestValue
- expected value of fieldnewValue
- new value of fieldtrue
=> successful swap, false
=> field not equal to testValuepublic static boolean tryCompareAndSwap(Object base, Offset offset, Word testValue, Word newValue)
base
- object containing fieldoffset
- position of fieldtestValue
- expected value of fieldnewValue
- new value of fieldtrue
=> successful swap, false
=> field not equal to testValuepublic static boolean tryCompareAndSwap(Object base, Offset offset, Address testValue, Address newValue)
base
- object containing fieldoffset
- position of fieldtestValue
- expected value of fieldnewValue
- new value of fieldtrue
=> successful swap, false
=> field not equal to testValuepublic static boolean tryCompareAndSwap(Object base, Offset offset, Object testValue, Object newValue)
base
- object containing fieldoffset
- position of fieldtestValue
- expected value of fieldnewValue
- new value of fieldtrue
=> successful swap, false
=> field not equal to testValuepublic static boolean testAndSet(Object base, Offset offset, int newValue)
public static int fetchAndStore(Object base, Offset offset, int newValue)
public static Address fetchAndStoreAddress(Object base, Offset offset, Address newValue)
public static int fetchAndAdd(Object base, Offset offset, int increment)
public static int fetchAndDecrement(Object base, Offset offset, int decrement)
public static Address fetchAndAddAddressWithBound(Object base, Offset offset, int increment, Address bound)
public static Address fetchAndSubAddressWithBound(Object base, Offset offset, int decrement, Address bound)