Skip to content

Commit f1c64ff

Browse files
committed
Fix data-race in Mutex owner when mutex is locked/released inconsistently
Fixes #3250
1 parent 35cd6d4 commit f1c64ff

File tree

1 file changed

+1
-1
lines changed
  • kotlinx-coroutines-core/common/src/sync

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/common/src/sync/Mutex.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ internal class MutexImpl(locked: Boolean) : Mutex, SelectClause2<Any?, Mutex> {
361361
}
362362

363363
private class LockedQueue(
364-
@JvmField var owner: Any
364+
@Volatile @JvmField var owner: Any
365365
) : LockFreeLinkedListHead() {
366366
override fun toString(): String = "LockedQueue[$owner]"
367367
}

0 commit comments

Comments
 (0)