Skip to content

Commit

Permalink
Fix data-race in Mutex owner when mutex is locked/released inconsiste…
Browse files Browse the repository at this point in the history
…ntly (Kotlin#3286)

Fixes Kotlin#3250
  • Loading branch information
qwwdfsad authored and pablobaxter committed Sep 14, 2022
1 parent a126187 commit fb726eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/common/src/sync/Mutex.kt
Expand Up @@ -361,7 +361,7 @@ internal class MutexImpl(locked: Boolean) : Mutex, SelectClause2<Any?, Mutex> {
}

private class LockedQueue(
@JvmField var owner: Any
@Volatile @JvmField var owner: Any
) : LockFreeLinkedListHead() {
override fun toString(): String = "LockedQueue[$owner]"
}
Expand Down

0 comments on commit fb726eb

Please sign in to comment.