How does mutex implement blocking when a lock is already acquired?
Copy code
scope.launch {
mutex.withLock { ... }
}
Here, does the mutex block the suspend the coroutine just like
delay()
(such that it doesn't block a thread's execution but just the coroutine) or a total thread block making essentially all coroutines (scheduled on that thread) blocked as well?
e
ephemient
02/13/2024, 1:52 PM
the coroutine is suspended until it is runnable again (e.g. when the lock is released elsewhere), it does not block the thread