Liking cljdoc? Tell your friends :D

jdk.util.concurrent.atomic.AtomicStampedReference

An AtomicStampedReference maintains an object reference along with an integer "stamp", that can be updated atomically.

Implementation note: This implementation maintains stamped references by creating internal objects representing "boxed" [reference, integer] pairs.

An AtomicStampedReference maintains an object reference
along with an integer "stamp", that can be updated atomically.

Implementation note: This implementation maintains stamped
references by creating internal objects representing "boxed"
[reference, integer] pairs.
raw docstring

->atomic-stamped-referenceclj

(->atomic-stamped-reference initial-ref initial-stamp)

Constructor.

Creates a new AtomicStampedReference with the given initial values.

initial-ref - the initial reference - V initial-stamp - the initial stamp - int

Constructor.

Creates a new AtomicStampedReference with the given
 initial values.

initial-ref - the initial reference - `V`
initial-stamp - the initial stamp - `int`
raw docstring

attempt-stampclj

(attempt-stamp this expected-reference new-stamp)

Atomically sets the value of the stamp to the given update value if the current reference is == to the expected reference. Any given invocation of this operation may fail (return false) spuriously, but repeated invocation when the current value holds the expected value and no other thread is also attempting to set the value will eventually succeed.

expected-reference - the expected value of the reference - V new-stamp - the new value for the stamp - int

returns: true if successful - boolean

Atomically sets the value of the stamp to the given update value
 if the current reference is == to the expected
 reference.  Any given invocation of this operation may fail
 (return false) spuriously, but repeated invocation
 when the current value holds the expected value and no other
 thread is also attempting to set the value will eventually
 succeed.

expected-reference - the expected value of the reference - `V`
new-stamp - the new value for the stamp - `int`

returns: true if successful - `boolean`
raw docstring

compare-and-setclj

(compare-and-set this expected-reference new-reference expected-stamp new-stamp)

Atomically sets the value of both the reference and stamp to the given update values if the current reference is == to the expected reference and the current stamp is equal to the expected stamp.

expected-reference - the expected value of the reference - V new-reference - the new value for the reference - V expected-stamp - the expected value of the stamp - int new-stamp - the new value for the stamp - int

returns: true if successful - boolean

Atomically sets the value of both the reference and stamp
 to the given update values if the
 current reference is == to the expected reference
 and the current stamp is equal to the expected stamp.

expected-reference - the expected value of the reference - `V`
new-reference - the new value for the reference - `V`
expected-stamp - the expected value of the stamp - `int`
new-stamp - the new value for the stamp - `int`

returns: true if successful - `boolean`
raw docstring

getclj

(get this stamp-holder)

Returns the current values of both the reference and the stamp. Typical usage is int[1] holder; ref = v.get(holder); .

stamp-holder - an array of size of at least one. On return, stampholder[0] will hold the value of the stamp. - int[]

returns: the current value of the reference - V

Returns the current values of both the reference and the stamp.
 Typical usage is int[1] holder; ref = v.get(holder); .

stamp-holder - an array of size of at least one. On return, stampholder[0] will hold the value of the stamp. - `int[]`

returns: the current value of the reference - `V`
raw docstring

get-referenceclj

(get-reference this)

Returns the current value of the reference.

returns: the current value of the reference - V

Returns the current value of the reference.

returns: the current value of the reference - `V`
raw docstring

get-stampclj

(get-stamp this)

Returns the current value of the stamp.

returns: the current value of the stamp - int

Returns the current value of the stamp.

returns: the current value of the stamp - `int`
raw docstring

setclj

(set this new-reference new-stamp)

Unconditionally sets the value of both the reference and stamp.

new-reference - the new value for the reference - V new-stamp - the new value for the stamp - int

Unconditionally sets the value of both the reference and stamp.

new-reference - the new value for the reference - `V`
new-stamp - the new value for the stamp - `int`
raw docstring

weak-compare-and-setclj

(weak-compare-and-set this
                      expected-reference
                      new-reference
                      expected-stamp
                      new-stamp)

Atomically sets the value of both the reference and stamp to the given update values if the current reference is == to the expected reference and the current stamp is equal to the expected stamp.

May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet.

expected-reference - the expected value of the reference - V new-reference - the new value for the reference - V expected-stamp - the expected value of the stamp - int new-stamp - the new value for the stamp - int

returns: true if successful - boolean

Atomically sets the value of both the reference and stamp
 to the given update values if the
 current reference is == to the expected reference
 and the current stamp is equal to the expected stamp.

 May fail
 spuriously and does not provide ordering guarantees, so is
 only rarely an appropriate alternative to compareAndSet.

expected-reference - the expected value of the reference - `V`
new-reference - the new value for the reference - `V`
expected-stamp - the expected value of the stamp - `int`
new-stamp - the new value for the stamp - `int`

returns: true if successful - `boolean`
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close