mirror of
https://github.com/kopia/kopia.git
synced 2026-03-26 01:51:20 -04:00
test(providers): notify after releasing the lock (#5154)
Following the recommended pattern with the expectation of reducing potential deadlocks in future changes.
This commit is contained in:
@@ -48,12 +48,14 @@ func (vf *verifySyncBeforeCloseFile) Sync() error {
|
||||
}
|
||||
|
||||
func (vf *verifySyncBeforeCloseFile) Close() error {
|
||||
vf.mu.Lock()
|
||||
defer vf.mu.Unlock()
|
||||
dirty, err := func() (bool, error) {
|
||||
vf.mu.Lock()
|
||||
defer vf.mu.Unlock()
|
||||
|
||||
err := vf.osWriteFile.Close()
|
||||
return vf.dirty, vf.osWriteFile.Close()
|
||||
}()
|
||||
|
||||
if vf.dirty {
|
||||
if dirty {
|
||||
vf.notifyDirtyClose()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user