lock

abstract fun <T> lock(body: () -> T): T

Lock the fiber during evaluation of the Supplier, and return the produced value.

Return

The produced value.

Parameters

T

The type of value to produce while holding the lock.

body

The body to evaluate.