mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 Improve kernel stability by eliminating some data races https://github.com/siyuan-note/siyuan/issues/9842
This commit is contained in:
parent
8c5c62670e
commit
bea32e96d5
17 changed files with 158 additions and 117 deletions
|
|
@ -116,7 +116,7 @@ func removeDuplicateDatabaseIndex() {
|
|||
}
|
||||
deletes++
|
||||
toRemoveRootIDs = append(toRemoveRootIDs, rootID)
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -335,12 +335,12 @@ func fixBlockTreeByFileSys() {
|
|||
}
|
||||
|
||||
reindexTreeByPath(box.ID, p, i, size, luteEngine)
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -371,7 +371,7 @@ func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string) {
|
|||
for rootID, updated := range rootUpdatedMap {
|
||||
i++
|
||||
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string) {
|
|||
continue
|
||||
}
|
||||
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -407,7 +407,7 @@ func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string) {
|
|||
rootIDs = append(rootIDs, rootID)
|
||||
}
|
||||
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string) {
|
|||
}
|
||||
|
||||
toRemoveRootIDs = append(toRemoveRootIDs, id)
|
||||
if util.IsExiting {
|
||||
if util.IsExiting.Load() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue