- Index
- »
- concurrent
- »
- AtomicInt
type
AtomicInt
src
@Js
const class AtomicInt : Obj
AtomicInt is used to manage an integer variable shared between actor/threads with atomic updates.
constructors
make |
Construct with initial value |
---|
fields
val |
The current integer value |
---|
methods
add |
Atomically add the given value to the current value |
---|---|
addAndGet |
Atomically add the given value to the current value and return the updated value. |
compareAndSet |
Atomically set the value to |
decrement |
Atomically decrement the value by one |
decrementAndGet |
Atomically decrement the current value by one and return the updated value. |
getAndAdd |
Atomically add the given value to the current value and return the previous value. |
getAndDecrement |
Atomically decrement the current value by one and return the previous value. |
getAndIncrement |
Atomically increment the current value by one and return the previous value. |
getAndSet |
Atomically set the value and return the previous value. |
increment |
Atomically increment the value by one |
incrementAndGet |
Atomically increment the current value by one and return the updated value. |
toStr |
Return |