API Reference › Sync › Sync.cas
method

Sync.cas

Sync.cas(atomic, expect, next) -> bool

Compare-and-set the counter.

Example

let a = Sync.atomic()
let swapped = Sync.cas(a, 0, 1)
← All symbols