A cross-platform atomic integer.
On the JVM, backed by AtomicInteger. Thread-safe for concurrent operations. On ClojureScript, backed by a mutable integer (single-threaded).
A cross-platform atomic integer. On the JVM, backed by AtomicInteger. Thread-safe for concurrent operations. On ClojureScript, backed by a mutable integer (single-threaded).
(compareAndSet i expected assigned)Set the integer to assigned if its current value is expected.
Returns true if the update succeeded, false otherwise.
Set the integer to assigned if its current value is expected. Returns true if the update succeeded, false otherwise.
(decrementAndGet i)Decrement the integer and return the new value.
Decrement the integer and return the new value.
(getAndDecrement i)Return the current value, then decrement.
Return the current value, then decrement.
(getAndIncrement i)Return the current value, then increment.
Return the current value, then increment.
(getAndUpdate i f)Return the current value, then update by applying f to it.
Return the current value, then update by applying f to it.
(getValue i)Get the current value of the integer.
Get the current value of the integer.
(incrementAndGet i)Increment the integer and return the new value.
Increment the integer and return the new value.
(integer n)Create a new atomic integer with initial value n.
Create a new atomic integer with initial value n.
(updateAndGet i f)Update the integer by applying f to it, then return the new value.
Update the integer by applying f to it, then return the new value.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |