🎨 Improve kernel stability by eliminating some data races https://github.com/siyuan-note/siyuan/issues/9842

This commit is contained in:
Daniel 2023-12-09 10:41:00 +08:00
parent 73505073e6
commit 150336dcf5
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -238,8 +238,8 @@ func RemoveBlockTreesByRootID(rootID string) {
slice := val.(*btSlice)
slice.m.Lock()
delete(slice.data, id)
slice.m.Unlock()
slice.changed = time.Now()
slice.m.Unlock()
}
}
@ -296,8 +296,8 @@ func RemoveBlockTreesByPathPrefix(pathPrefix string) {
slice := val.(*btSlice)
slice.m.Lock()
delete(slice.data, id)
slice.m.Unlock()
slice.changed = time.Now()
slice.m.Unlock()
}
}
@ -338,8 +338,8 @@ func RemoveBlockTreesByBoxID(boxID string) (ids []string) {
slice := val.(*btSlice)
slice.m.Lock()
delete(slice.data, id)
slice.m.Unlock()
slice.changed = time.Now()
slice.m.Unlock()
}
return
}
@ -352,8 +352,8 @@ func RemoveBlockTree(id string) {
slice := val.(*btSlice)
slice.m.Lock()
delete(slice.data, id)
slice.m.Unlock()
slice.changed = time.Now()
slice.m.Unlock()
}
func IndexBlockTree(tree *parse.Tree) {