Check that storage lock guarantees are met
This commit is contained in:
parent
5d969ff65c
commit
ddd99a5329
@ -1591,6 +1591,9 @@ class FileBackedRwLock:
|
|||||||
raise RuntimeError("Locking the storage failed: "
|
raise RuntimeError("Locking the storage failed: "
|
||||||
"Unsupported operating system")
|
"Unsupported operating system")
|
||||||
with self._lock:
|
with self._lock:
|
||||||
|
if self._writer or mode == "w" and self._readers != 0:
|
||||||
|
raise RuntimeError("Locking the storage failed: "
|
||||||
|
"Guarantees failed")
|
||||||
if mode == "r":
|
if mode == "r":
|
||||||
self._readers += 1
|
self._readers += 1
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user