mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Check that storage lock guarantees are met
This commit is contained in:
parent
5d969ff65c
commit
ddd99a5329
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue