tryRun

suspend fun <T> tryRun(block: suspend () -> T): T?(source)

Executes block only if the lock is not currently held. If another coroutine is already inside run or tryRun, this call returns null immediately without suspending.

Return

The return value of block, or null if skipped.