SmartRWLocker now will wait first unlock of write mutex for acquiring read

This commit is contained in:
InsanusMokrassar committed 2023-10-26 12:28:24 +06:00
1 parent f6d0f72e49
commit 075b93ecd6
2 files changed
+4

No files matched your search

@@ -23,6 +23,7 @@ class SmartRWLocker(private val readPermits: Int = Int.MAX_VALUE, writeIsLocked:
* Do lock in [readSemaphore] inside of [writeMutex] locking
*/
suspend fun acquireRead() {
_writeMutex.waitUnlock()
_readSemaphore.acquire()
}