diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fdd5d7a415..cb2b337d799 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.20.5 +* `Coroutines`: + * Fixes in `SmartRWLocker` + ## 0.20.4 * `Versions`: diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt index e1a6e7eb694..7aaf845cb81 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SmartRWLocker.kt @@ -37,8 +37,8 @@ class SmartRWLocker(private val readPermits: Int = Int.MAX_VALUE, writeIsLocked: * Locking [writeMutex] and wait while all [readSemaphore] permits will be freed */ suspend fun lockWrite() { - _readSemaphore.acquire(readPermits) _writeMutex.lock() + _readSemaphore.acquire(readPermits) } /**