ReentrantLock

@ThreadSafe
class ReentrantLock

A poor man's reimplementation of the JVM ReentrantLock class.

Programmer's note: I am very nervous about this. This is an experiment to see if I can port my JVM library over to multiplatform, and Kotter makes use of reentrant locks, which are otherwise not provided for the Kotlin/Native target. Unfortunately, some Kotter APIs expose reentrant locks which means this class is now exposed to users. Fortunately, it's not expected most users will ever interact with it, unless they are extending Kotter, which is kind of advanced. For now, we'll experiment with this and see if it doesn't seem to cause any immediate concerns.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun lock()

Request a lock.

Link copied to clipboard
fun unlock()

Release a hold required by lock.

Link copied to clipboard
inline fun <T> ReentrantLock.withLock(block: () -> T): T