kotlinx.atomicfu

The idiomatic way to use atomic operations in Kotlin/JS, so that the same code can be shared with Kotlin/JVM.

private val top = atomic<Node?>(null)

See README for more details.