|
AVPKit
|
Internal only. More...
#include <AtomicInteger.h>
Public Member Functions | |
| AtomicInteger (int32_t) | |
| int32_t | get () |
| void | set (int32_t) |
| int32_t | getAndSet (int32_t) |
| int32_t | getAndIncrement () |
| int32_t | getAndDecrement () |
| int32_t | getAndAdd (int32_t) |
| int32_t | incrementAndGet () |
| int32_t | decrementAndGet () |
| int32_t | addAndGet (int32_t) |
| bool | compareAndSet (int32_t expected, int32_t update) |
| Compare the current value to expected, and if they are equal, set the current value to update. More... | |
| bool | isAtomic () |
Friends | |
| class | JNIHelper |
Internal only.
Atomic Integer represents Integers than can be updated atomically from native code.
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
Definition at line 45 of file AtomicInteger.h.
| bool com::avpkit::ferry::AtomicInteger::compareAndSet | ( | int32_t | expected, |
| int32_t | update | ||
| ) |
Compare the current value to expected, and if they are equal, set the current value to update.
| expected | the value expected |
| update | the value to update to |
Definition at line 275 of file AtomicInteger.cpp.
| bool com::avpkit::ferry::AtomicInteger::isAtomic | ( | ) |
Definition at line 294 of file AtomicInteger.cpp.