Garret Yoder
01/18/2024, 7:02 PMkevin.cianfarini
01/18/2024, 7:03 PMpublic suspend inline fun <T> Mutex.withLock(owner: Any? = null, action: () -> T): T {
lock(owner)
return try {
action()
} finally {
unlock(owner)
}
}
So yes, cleanup will happen for you.Garret Yoder
01/18/2024, 7:04 PMkevin.cianfarini
01/18/2024, 7:08 PMGarret Yoder
01/18/2024, 7:13 PM