public class AtomicCounter
extends java.lang.Object
implements java.lang.AutoCloseable
AtomicBuffer that can be read across threads and processes.| Modifier and Type | Method and Description |
|---|---|
long |
add(long increment)
Add an increment to the counter that will not lose updates across threads.
|
long |
addOrdered(long increment)
Add an increment to the counter with ordered store semantics.
|
void |
close()
Free the counter slot for reuse.
|
long |
get()
Get the latest value for the counter.
|
long |
getWeak()
Get the value of the counter using weak ordering semantics.
|
long |
increment()
Perform an atomic increment that will not lose updates across threads.
|
boolean |
isClosed()
Has this counter been closed?
|
long |
orderedIncrement()
Perform an atomic increment that is not safe across threads.
|
void |
set(long value)
Set the counter with volatile semantics.
|
void |
setOrdered(long value)
Set the counter with ordered semantics.
|
void |
setWeak(long value)
Set the counter with normal semantics.
|
public boolean isClosed()
public long increment()
public long orderedIncrement()
public void set(long value)
value - to be set with volatile semantics.public void setOrdered(long value)
value - to be set with ordered semantics.public void setWeak(long value)
value - to be set with normal semantics.public long add(long increment)
increment - to be added.public long addOrdered(long increment)
increment - to be added with ordered store semantics.public long get()
public long getWeak()
public void close()
close in interface java.lang.AutoCloseableCopyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.