https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

mbonnin

07/17/2019, 9:59 AM
If I have several coroutines suspended on a Mutex (they all lock from the same thread), will they resume in the same order as they tried to acquire the lock or is this undetermined ?
m

Marko Mitic

07/17/2019, 9:59 AM
I wanted to know this too, is Mutex fair or not?
This function is fair; suspended callers are resumed in first-in-first-out order.
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.sync/-mutex/lock.html
Now we know
m

mbonnin

07/17/2019, 10:00 AM
Ah, perfect, thanks !
20 Views