
public class AtomicInteger extends Object
This object is NOT meant to be called from Java (in fact, that'd be stupid
since you'd just be calling from native code back into Java). It's
here so that native code inside a JVM can have access to portable
thread-safe objects.
And that said, this method is really only Atomic if running inside a
Java JVM (or other virtual machine that can provide the functionality).
If running in a standalone C++ program there
is no current guarantee of Atomicity.
The object just forwards to the Java object:
java.util.concurrent.atomic.AtomicInteger
| Constructor and Description |
|---|
AtomicInteger() |
AtomicInteger(int arg0) |
| Modifier and Type | Method and Description |
|---|---|
int |
addAndGet(int arg0) |
boolean |
compareAndSet(int expected,
int update)
Compare the current value to expected, and if
they are equal, set the current value to update. |
int |
decrementAndGet() |
void |
delete()
Releases any underlying native memory and marks this object
as invalid.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
int |
get() |
int |
getAndAdd(int arg0) |
int |
getAndDecrement() |
int |
getAndIncrement() |
int |
getAndSet(int arg0) |
int |
hashCode()
Get a hashable value for this object.
|
int |
incrementAndGet() |
boolean |
isAtomic() |
void |
set(int arg0) |
public AtomicInteger()
public AtomicInteger(int arg0)
public boolean equals(Object obj)
public int hashCode()
public void delete()
Normally Ferry manages when to release native memory.
In the unlikely event you want to control EXACTLY when a native
object is released, each Humble object has a delete()
method that you can use. Once you call delete(),
you must ENSURE your object is never referenced again from
that Java object -- Ferry tries to help you avoid crashes if you
accidentally use an object after deletion but on this but we
cannot offer 100% protection (specifically if another thread
is accessing that object EXACTLY when you delete() it).
public int get()
public void set(int arg0)
public int getAndSet(int arg0)
public int getAndIncrement()
public int getAndDecrement()
public int getAndAdd(int arg0)
public int incrementAndGet()
public int decrementAndGet()
public int addAndGet(int arg0)
public boolean compareAndSet(int expected,
int update)
expected - the value expectedupdate - the value to update topublic boolean isAtomic()
Copyright © 2018 Humble Software. All rights reserved.