From f1c64ff116deb4fe06eb4d46583adc0c803bfbd4 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Mon, 16 May 2022 12:23:44 +0300 Subject: [PATCH] Fix data-race in Mutex owner when mutex is locked/released inconsistently Fixes #3250 --- kotlinx-coroutines-core/common/src/sync/Mutex.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/src/sync/Mutex.kt b/kotlinx-coroutines-core/common/src/sync/Mutex.kt index d2a2fcd41b..681d5db6b0 100644 --- a/kotlinx-coroutines-core/common/src/sync/Mutex.kt +++ b/kotlinx-coroutines-core/common/src/sync/Mutex.kt @@ -361,7 +361,7 @@ internal class MutexImpl(locked: Boolean) : Mutex, SelectClause2 { } private class LockedQueue( - @JvmField var owner: Any + @Volatile @JvmField var owner: Any ) : LockFreeLinkedListHead() { override fun toString(): String = "LockedQueue[$owner]" }