core / pragma.utils / AlertingMutex /

AlertingMutex #

class AlertingMutex(locked: Boolean = false) : Mutex

AlertingMutex is an implementation of the Mutex interface that will log a warning if it cannot obtain a lock after 5000 ms.

References

  • kotlinx.coroutines.sync.Mutex

Constructors #

AlertingMutex

fun AlertingMutex(locked: Boolean = false)

Functions #

NameSummary

holdsLock

open override fun holdsLock(owner: Any): Boolean

see kotlinx.coroutines.sync.Mutex.holdsLock

lock

open suspend override fun lock(owner: Any?)

In addition to obtaining the lock, this method also starts a coroutine that will log a warning after 5000 ms.

tryLock

open override fun tryLock(owner: Any?): Boolean

see kotlinx.coroutines.sync.Mutex.tryLock

unlock

open override fun unlock(owner: Any?)

see kotlinx.coroutines.sync.Mutex.unlock

Properties #

NameSummary

isLocked

open override val isLocked: Boolean

see kotlinx.coroutines.sync.Mutex.isLocked