Scoop API

scoop:scoop.core:0.1.0

Atomic

class Atomic

source · line 5
public
public class Atomic<T: value> public constructor(initial: T)

A lock-protected cell for any value type, including values containing managed references. Operations copy the whole value under the cell lock.

function exchange

source · line 51
public
public fun exchange(value: T): T

Replaces the value under one lock acquisition and returns the previous value.

function load

source · line 12
public
public fun load(): T

Copies the stored value while holding the cell lock.