How does mutex implement blocking when a lock is a...
# getting-started
j
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
the coroutine is suspended until it is runnable again (e.g. when the lock is released elsewhere), it does not block the thread
j
@ephemient Oh I see, thanks for clarifying!