withSpinLock

fun <T> Mutex.withSpinLock(block: () -> T): T

Locks the mutex with spinLock. WARNING: This blocks the current thread!