|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.btrace.BTraceUtils.Atomic
public static class BTraceUtils.Atomic
Constructor Summary | |
---|---|
BTraceUtils.Atomic()
|
Method Summary | |
---|---|
static int |
addAndGet(java.util.concurrent.atomic.AtomicInteger ai,
int delta)
Atomically adds the given value to the current value. |
static long |
addAndGet(java.util.concurrent.atomic.AtomicLong al,
long delta)
Atomically adds the given value to the current value. |
static boolean |
compareAndSet(java.util.concurrent.atomic.AtomicInteger ai,
int expect,
int update)
Atomically sets the value of given AtomitInteger to the given updated value if the current value == the expected value. |
static boolean |
compareAndSet(java.util.concurrent.atomic.AtomicLong al,
long expect,
long update)
Atomically sets the value to the given updated value if the current value == the expected value. |
static int |
decrementAndGet(java.util.concurrent.atomic.AtomicInteger ai)
Atomically decrements by one the current value of given AtomicInteger. |
static long |
decrementAndGet(java.util.concurrent.atomic.AtomicLong al)
Atomically decrements by one the current value. |
static int |
get(java.util.concurrent.atomic.AtomicInteger ai)
Gets the current value of the given AtomicInteger. |
static long |
get(java.util.concurrent.atomic.AtomicLong al)
Gets the current value the given AtomicLong. |
static int |
getAndAdd(java.util.concurrent.atomic.AtomicInteger ai,
int delta)
Atomically adds the given value to the current value. |
static long |
getAndAdd(java.util.concurrent.atomic.AtomicLong al,
long delta)
Atomically adds the given value to the current value. |
static int |
getAndDecrement(java.util.concurrent.atomic.AtomicInteger ai)
Atomically decrements by one the current value of given AtomicInteger. |
static long |
getAndDecrement(java.util.concurrent.atomic.AtomicLong al)
Atomically decrements by one the current value. |
static int |
getAndIncrement(java.util.concurrent.atomic.AtomicInteger ai)
Atomically increments by one the current value of given AtomicInteger. |
static long |
getAndIncrement(java.util.concurrent.atomic.AtomicLong al)
Atomically increments by one the current value. |
static int |
getAndSet(java.util.concurrent.atomic.AtomicInteger ai,
int newValue)
Atomically sets to the given value and returns the old value. |
static long |
getAndSet(java.util.concurrent.atomic.AtomicLong al,
long newValue)
Atomically sets to the given value and returns the old value. |
static int |
incrementAndGet(java.util.concurrent.atomic.AtomicInteger ai)
Atomically increments by one the current value of given AtomicInteger. |
static long |
incrementAndGet(java.util.concurrent.atomic.AtomicLong al)
Atomically increments by one the current value. |
static void |
lazySet(java.util.concurrent.atomic.AtomicInteger ai,
int newValue)
Eventually sets to the given value to the given AtomicInteger. |
static void |
lazySet(java.util.concurrent.atomic.AtomicLong al,
long newValue)
Eventually sets to the given value to the given AtomicLong. |
static java.util.concurrent.atomic.AtomicInteger |
newAtomicInteger(int initialValue)
Creates a new AtomicInteger with the given initial value. |
static java.util.concurrent.atomic.AtomicLong |
newAtomicLong(long initialValue)
Creates a new AtomicLong with the given initial value. |
static void |
set(java.util.concurrent.atomic.AtomicInteger ai,
int newValue)
Sets to the given value to the given AtomicInteger. |
static void |
set(java.util.concurrent.atomic.AtomicLong al,
long newValue)
Sets to the given value. |
static boolean |
weakCompareAndSet(java.util.concurrent.atomic.AtomicInteger ai,
int expect,
int update)
Atomically sets the value to the given updated value if the current value == the expected value. |
static boolean |
weakCompareAndSet(java.util.concurrent.atomic.AtomicLong al,
long expect,
long update)
Atomically sets the value to the given updated value if the current value == the expected value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BTraceUtils.Atomic()
Method Detail |
---|
public static java.util.concurrent.atomic.AtomicInteger newAtomicInteger(int initialValue)
initialValue
- the initial valuepublic static int get(java.util.concurrent.atomic.AtomicInteger ai)
ai
- AtomicInteger whose value is returned.
public static void set(java.util.concurrent.atomic.AtomicInteger ai, int newValue)
ai
- AtomicInteger whose value is set.newValue
- the new valuepublic static void lazySet(java.util.concurrent.atomic.AtomicInteger ai, int newValue)
ai
- AtomicInteger whose value is lazily set.newValue
- the new valuepublic static boolean compareAndSet(java.util.concurrent.atomic.AtomicInteger ai, int expect, int update)
==
the expected value.
ai
- AtomicInteger whose value is compared and set.expect
- the expected valueupdate
- the new value
public static boolean weakCompareAndSet(java.util.concurrent.atomic.AtomicInteger ai, int expect, int update)
==
the expected value.
May fail spuriously
and does not provide ordering guarantees, so is only rarely an
appropriate alternative to compareAndSet
.
ai
- AtomicInteger whose value is weakly compared and set.expect
- the expected valueupdate
- the new value
public static int getAndIncrement(java.util.concurrent.atomic.AtomicInteger ai)
ai
- AtomicInteger that is incremented.
public static int getAndDecrement(java.util.concurrent.atomic.AtomicInteger ai)
ai
- AtomicInteger that is decremented.
public static int incrementAndGet(java.util.concurrent.atomic.AtomicInteger ai)
ai
- AtomicInteger that is incremented.
public static int decrementAndGet(java.util.concurrent.atomic.AtomicInteger ai)
ai
- AtomicInteger whose value is decremented.
public static int getAndAdd(java.util.concurrent.atomic.AtomicInteger ai, int delta)
ai
- AtomicInteger whose value is added to.delta
- the value to add
public static int addAndGet(java.util.concurrent.atomic.AtomicInteger ai, int delta)
ai
- AtomicInteger whose value is added to.delta
- the value to add
public static int getAndSet(java.util.concurrent.atomic.AtomicInteger ai, int newValue)
ai
- AtomicInteger whose value is set.newValue
- the new value
public static java.util.concurrent.atomic.AtomicLong newAtomicLong(long initialValue)
initialValue
- the initial valuepublic static long get(java.util.concurrent.atomic.AtomicLong al)
al
- AtomicLong whose value is returned.
public static void set(java.util.concurrent.atomic.AtomicLong al, long newValue)
al
- AtomicLong whose value is set.newValue
- the new valuepublic static void lazySet(java.util.concurrent.atomic.AtomicLong al, long newValue)
al
- AtomicLong whose value is set.newValue
- the new valuepublic static boolean compareAndSet(java.util.concurrent.atomic.AtomicLong al, long expect, long update)
==
the expected value.
al
- AtomicLong whose value is compared and set.expect
- the expected valueupdate
- the new value
public static boolean weakCompareAndSet(java.util.concurrent.atomic.AtomicLong al, long expect, long update)
==
the expected value.
May fail spuriously
and does not provide ordering guarantees, so is only rarely an
appropriate alternative to compareAndSet
.
al
- AtomicLong whose value is compared and set.expect
- the expected valueupdate
- the new value
public static long getAndIncrement(java.util.concurrent.atomic.AtomicLong al)
al
- AtomicLong whose value is incremented.
public static long getAndDecrement(java.util.concurrent.atomic.AtomicLong al)
al
- AtomicLong whose value is decremented.
public static long incrementAndGet(java.util.concurrent.atomic.AtomicLong al)
al
- AtomicLong whose value is incremented.
public static long decrementAndGet(java.util.concurrent.atomic.AtomicLong al)
al
- AtomicLong whose value is decremented.
public static long getAndAdd(java.util.concurrent.atomic.AtomicLong al, long delta)
al
- AtomicLong whose value is added to.delta
- the value to add
public static long addAndGet(java.util.concurrent.atomic.AtomicLong al, long delta)
al
- AtomicLong whose value is added todelta
- the value to add
public static long getAndSet(java.util.concurrent.atomic.AtomicLong al, long newValue)
al
- AtomicLong that is set.newValue
- the new value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |