public final class ConcurrencyUtil extends Object
ConcurrentMap
with a ConstructorFunction
.Modifier and Type | Field and Description |
---|---|
static Executor |
CALLER_RUNS
The Caller runs executor is an Executor that executes the task on the calling thread.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> V |
getOrPutIfAbsent(ConcurrentMap<K,V> map,
K key,
ConstructorFunction<K,V> func) |
static <K,V> V |
getOrPutSynchronized(ConcurrentMap<K,V> map,
K key,
ContextMutexFactory contextMutexFactory,
ConstructorFunction<K,V> func) |
static <K,V> V |
getOrPutSynchronized(ConcurrentMap<K,V> map,
K key,
Object mutex,
ConstructorFunction<K,V> func) |
static boolean |
setIfEqualOrGreaterThan(AtomicLong oldValue,
long newValue) |
static <E> void |
setMax(E obj,
AtomicLongFieldUpdater<E> updater,
long value)
Atomically sets the max value.
|
public static final Executor CALLER_RUNS
public static <E> void setMax(E obj, AtomicLongFieldUpdater<E> updater, long value)
public static boolean setIfEqualOrGreaterThan(AtomicLong oldValue, long newValue)
public static <K,V> V getOrPutSynchronized(ConcurrentMap<K,V> map, K key, Object mutex, ConstructorFunction<K,V> func)
public static <K,V> V getOrPutSynchronized(ConcurrentMap<K,V> map, K key, ContextMutexFactory contextMutexFactory, ConstructorFunction<K,V> func)
public static <K,V> V getOrPutIfAbsent(ConcurrentMap<K,V> map, K key, ConstructorFunction<K,V> func)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.