tryLock

abstract fun tryLock(owner: Any? = null): Boolean (source)

Platform and version requirements: JVM

Tries to lock this mutex, returning false if this mutex is already locked.

Parameters

owner - Optional owner token for debugging. When owner is specified (non-null value) and this mutex is already locked with the same token (same identity), this function throws IllegalStateException.