NonRecursiveLock

expect class NonRecursiveLock : BaseLock

Optimized lock that cannot be called inside another lock, don't keep the current thread id, or a list of threads to awake It is lightweight and just requires an atomic. Does busy-waiting instead of sleeping the thread.

actual class NonRecursiveLock : BaseLock
actual class NonRecursiveLock : BaseLock
actual class NonRecursiveLock : BaseLock

Constructors

Link copied to clipboard
expect constructor()
actual constructor()
actual constructor()
actual constructor()

Functions

Link copied to clipboard
expect inline operator fun <T> invoke(callback: () -> T): T
actual inline operator fun <T> invoke(callback: () -> T): T
actual inline operator fun <T> invoke(callback: () -> T): T
actual inline operator fun <T> invoke(callback: () -> T): T
Link copied to clipboard
fun lock()
Link copied to clipboard
expect open override fun notify(unit: Unit)
actual open override fun notify(unit: Unit)
actual open override fun notify(unit: Unit)
actual open override fun notify(unit: Unit)
Link copied to clipboard
fun unlock()
Link copied to clipboard
expect open override fun wait(time: TimeSpan): Boolean
actual open override fun wait(time: TimeSpan): Boolean
actual open override fun wait(time: TimeSpan): Boolean
actual open override fun wait(time: TimeSpan): Boolean
Link copied to clipboard
fun BaseLock.wait(time: TimeSpan, precise: Boolean): Boolean
Link copied to clipboard