fixes in SmartRWLocker

This commit is contained in:
InsanusMokrassar 2023-09-07 16:57:59 +06:00
parent 53c2d552ec
commit 2a20d24589
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,9 @@
## 0.20.5
* `Coroutines`:
* Fixes in `SmartRWLocker`
## 0.20.4
* `Versions`:

View File

@ -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)
}
/**