Package io.deephaven.base
Class AtomicUtil
java.lang.Object
io.deephaven.base.AtomicUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intatomicAnd(AtomicInteger i, int mask) static intatomicAndNot(AtomicInteger i, int mask) static intatomicOr(AtomicInteger i, int mask) static intchangeAndGetIfGreaterThan(AtomicInteger i, int by, int pivot, int negative) static longchangeAndGetIfGreaterThan(AtomicLong i, long by, long pivot, long negative) static intchangeAndGetIfLessThan(AtomicInteger i, int by, int pivot, int negative) static longchangeAndGetIfLessThan(AtomicLong i, long by, long pivot, long negative) static longcompareAndSetAndGetOld(AtomicLong i, long expected, long updated) static intgetAndDecreaseIfGreaterThan(AtomicInteger i, int by, int pivot) static longgetAndDecreaseIfGreaterThan(AtomicLong i, long by, long pivot) static intgetAndIncreaseIfLessThan(AtomicInteger i, int by, int pivot) static longgetAndIncreaseIfLessThan(AtomicLong i, long by, long pivot) static longgetAndSetIfDecreases(AtomicLong i, long value) static longgetAndSetIfDecreases(AtomicLong i, long by, long value) static intgetAndSetIfGreaterThan(AtomicInteger i, int value, int pivot) static longgetAndSetIfGreaterThan(AtomicLong i, long value, long pivot) static intgetAndSetIfIncreases(AtomicInteger i, int value) static longgetAndSetIfIncreases(AtomicLong i, long value) static intgetAndSetIfIncreasesBy(AtomicInteger i, int by, int value) static longgetAndSetIfIncreasesBy(AtomicLong i, long by, long value) static intgetAndSetIfLessThan(AtomicInteger i, int value, int pivot) static longgetAndSetIfLessThan(AtomicLong i, long value, long pivot) static booleansetIfGreaterThan(AtomicInteger i, int pivot, int value) static booleansetIfGreaterThan(AtomicLong i, long pivot, long value) static booleansetIfLessThan(AtomicInteger i, int pivot, int value) static booleansetIfLessThan(AtomicLong i, long pivot, long value) static <T> booleansetMax(T o, AtomicLongFieldUpdater<T> fu, long value) Sets the field to the maximum of the current value and the passed in valuestatic <T> booleansetMin(T o, AtomicLongFieldUpdater<T> fu, long value) Sets the field to the minimum of the current value and the passed in value
-
Constructor Details
-
AtomicUtil
public AtomicUtil()
-
-
Method Details
-
compareAndSetAndGetOld
-
getAndSetIfIncreases
-
getAndSetIfIncreasesBy
-
getAndSetIfDecreases
-
getAndSetIfDecreases
-
getAndSetIfIncreases
-
getAndSetIfIncreasesBy
-
setIfLessThan
-
setIfGreaterThan
-
changeAndGetIfLessThan
-
getAndIncreaseIfLessThan
-
getAndDecreaseIfGreaterThan
-
getAndSetIfGreaterThan
-
getAndSetIfLessThan
-
changeAndGetIfGreaterThan
-
setIfLessThan
-
setIfGreaterThan
-
changeAndGetIfLessThan
-
changeAndGetIfGreaterThan
-
getAndSetIfGreaterThan
-
getAndSetIfLessThan
-
getAndIncreaseIfLessThan
-
getAndDecreaseIfGreaterThan
-
atomicOr
-
atomicAnd
-
atomicAndNot
-
setMin
Sets the field to the minimum of the current value and the passed in value- Type Parameters:
T- the type of o- Parameters:
o- the object to updatefu- the field updatervalue- the value that is a candidate for the minumum- Returns:
- true if the minimum was set
-
setMax
Sets the field to the maximum of the current value and the passed in value- Type Parameters:
T- the type of o- Parameters:
o- the object to updatefu- the field updatervalue- the value that is a candidate for the maximum- Returns:
- true if the maximum was set
-