mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-11-11 06:22:59 +00:00
fixes in SmartRWLocker
This commit is contained in:
1 parent
53c2d552ec
commit
2a20d24589
2 files changed
+4
-1
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user