mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
e782e034cc
commit
07abcd0121
9 changed files with 15 additions and 18 deletions
|
@ -144,8 +144,6 @@ func StatusLoop() {
|
|||
}
|
||||
}
|
||||
|
||||
var taskWaitGroup = sync.WaitGroup{}
|
||||
|
||||
func Loop() {
|
||||
for {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
@ -163,9 +161,7 @@ func Loop() {
|
|||
break
|
||||
}
|
||||
|
||||
taskWaitGroup.Add(1)
|
||||
go execTask(task)
|
||||
taskWaitGroup.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,5 +198,4 @@ func execTask(task *Task) {
|
|||
}
|
||||
|
||||
task.Handler.Call(args)
|
||||
taskWaitGroup.Done()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue