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
|
|
@ -27,6 +27,7 @@ import (
|
|||
"runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -60,7 +61,7 @@ func HookUILoaded() {
|
|||
}
|
||||
|
||||
// IsExiting 是否正在退出程序。
|
||||
var IsExiting = false
|
||||
var IsExiting = atomic.Bool{}
|
||||
|
||||
// MobileOSVer 移动端操作系统版本。
|
||||
var MobileOSVer string
|
||||
|
|
@ -171,12 +172,10 @@ func CheckFileSysStatus() {
|
|||
func checkFileSysStatus() {
|
||||
defer logging.Recover()
|
||||
|
||||
if gulu.IsMutexLocked(&checkFileSysStatusLock) {
|
||||
if !checkFileSysStatusLock.TryLock() {
|
||||
logging.LogWarnf("check file system status is locked, skip")
|
||||
return
|
||||
}
|
||||
|
||||
checkFileSysStatusLock.Lock()
|
||||
defer checkFileSysStatusLock.Unlock()
|
||||
|
||||
const fileSysStatusCheckFile = ".siyuan/filesys_status_check"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue