@Synchronized inline fun <T> atomicAction(action: () -> T): T
Executes an action atomically while keeping the synchronized lock to this object. Useful if you want to do multiple actions in one go without the possibility of a thread stealing ownership.
action
- Action to execute while keeping the lock this object.
Return
Result of action