Futura Api Documentation

Version: 0.3.0

futura.atomic

A clojure idiomatic wrapper for JDK atomic types.

boolean

(boolean v)

Create an instance of atomic boolean.

IAtomic

protocol

A common abstraction for atomic types.

members

compare-and-set!

(compare-and-set! _ v v')

Perform the CAS operation.

eventually-set!

(eventually-set! _ v)

Eventually set a new value.

get

(get _)

Get the current value.

get-and-set!

(get-and-set! _ v)

Set a new value and return the previous one.

set!

(set! _ v)

Set a new value.

IAtomicNumber

protocol

A common abstraction for number atomic types.

members

dec-and-get!

(dec-and-get! _)

Decrements the value and return it.

get-and-add!

(get-and-add! _ v)

Adds a delta and return the previous value.

get-and-dec!

(get-and-dec! _)

Decrements the value and return the previous one.

get-and-inc!

(get-and-inc! _)

Increments the value and returns the previous one.

inc-and-get!

(inc-and-get! _)

Increments the value and return it.

long

(long)(long n)

Create an instance of atomic long with optional initial value. If it is not provided, 0 will be the initial value.

ref

(ref v)

Create an instance of atomic reference.