mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +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
|
|
@ -84,8 +84,8 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
util.PushEndlessProgress(Conf.Language(73))
|
||||
defer util.ClearPushProgress(100)
|
||||
|
||||
syncLock.Lock()
|
||||
defer syncLock.Unlock()
|
||||
lockSync()
|
||||
defer unlockSync()
|
||||
|
||||
baseName := filepath.Base(zipPath)
|
||||
ext := filepath.Ext(baseName)
|
||||
|
|
@ -550,8 +550,8 @@ func ImportData(zipPath string) (err error) {
|
|||
util.PushEndlessProgress(Conf.Language(73))
|
||||
defer util.ClearPushProgress(100)
|
||||
|
||||
syncLock.Lock()
|
||||
defer syncLock.Unlock()
|
||||
lockSync()
|
||||
defer unlockSync()
|
||||
|
||||
baseName := filepath.Base(zipPath)
|
||||
ext := filepath.Ext(baseName)
|
||||
|
|
@ -605,6 +605,9 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
}
|
||||
}()
|
||||
|
||||
lockSync()
|
||||
defer unlockSync()
|
||||
|
||||
WaitForWritingFiles()
|
||||
|
||||
var baseHPath, baseTargetPath, boxLocalPath string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue