public interface Counter
Modifier and Type | Method and Description |
---|---|
long |
addAndGet(long delta)
Atomically adds the given value to the current value.
|
boolean |
compareAndSet(long expect,
long update)
Atomically updates the counter using a CAS operation
|
long |
decrementAndGet()
Atomically decrements the counter and returns the new value
|
long |
get()
Gets the current value of the counter
|
java.lang.String |
getName() |
long |
incrementAndGet()
Atomically increments the counter and returns the new value
|
void |
set(long new_value)
Sets the counter to a new value
|
java.lang.String getName()
long get()
void set(long new_value)
new_value
- The new valueboolean compareAndSet(long expect, long update)
expect
- The expected value of the counterupdate
- The new value of the counterlong incrementAndGet()
long decrementAndGet()
long addAndGet(long delta)
delta
- the value to addCopyright © 1998-2020 Red Hat. All Rights Reserved.