summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-11-26 16:25:48 +0000
committerLibravatar GitHub <noreply@github.com>2024-11-26 16:25:48 +0000
commit61f8f1e0e3236993f5522215f1900d35e49680c0 (patch)
treeb8bec737013b8213996a40ab913a810833ac5e4e /vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go
parent[bugfix] Allow unsetting filter expiration dates (#3560) (diff)
downloadgotosocial-61f8f1e0e3236993f5522215f1900d35e49680c0.tar.xz
pull in ncruces/go-sqlite3 v0.20.3 with tetratelabs/wazero v1.8.2 (#3574)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go b/vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go
index b901f98aa..0b6e5d342 100644
--- a/vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go
+++ b/vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go
@@ -50,14 +50,17 @@ func osGetExclusiveLock(file *os.File, state *LockLevel) _ErrorCode {
if rc != _OK {
// Reacquire the SHARED lock.
- osReadLock(file, _SHARED_FIRST, _SHARED_SIZE, 0)
+ if rc := osReadLock(file, _SHARED_FIRST, _SHARED_SIZE, 0); rc != _OK {
+ // notest // this should never happen
+ return _IOERR_RDLOCK
+ }
}
return rc
}
func osDowngradeLock(file *os.File, state LockLevel) _ErrorCode {
if state >= LOCK_EXCLUSIVE {
- // Release the EXCLUSIVE lock.
+ // Release the EXCLUSIVE lock while holding the PENDING lock.
osUnlock(file, _SHARED_FIRST, _SHARED_SIZE)
// Reacquire the SHARED lock.
@@ -78,7 +81,7 @@ func osDowngradeLock(file *os.File, state LockLevel) _ErrorCode {
}
func osReleaseLock(file *os.File, state LockLevel) _ErrorCode {
- // Release all locks.
+ // Release all locks, PENDING must be last.
if state >= LOCK_RESERVED {
osUnlock(file, _RESERVED_BYTE, 1)
}