-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
老问题了( #1121 )。我这里有两个 UE5 的worktree,若串行冷启动每个需要5秒左右,加在一起10秒多才能弹出主界面:
[git Watcher] Initialized in 322 ms
[combined Watcher] Initialized in 616 ms
[combined Watcher] Initialized in 774 ms
[combined Watcher] Initialized in 4550 ms
[wc Watcher] Initialized in 4580 ms
在读了 https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs 的代码之后,我建议重新研究
Task.Run(() => { combined.EnableRaisingEvents = true; });的可行性,因为从源码看来,无论你在哪个阶段调用 Dispose(),都能调到内部的 StopRaisingEvents() 从而令持有 inotify handle 的工作线程退出。注释也表明反复快速的 start/stop 应该是没问题的
// Start running. All state associated with the watch operation is stored in a separate object; this is done
// to avoid race conditions that could result if the users quickly starts/stops/starts/stops/etc. causing multiple
// active operations to all be outstanding at the same time.不过,有一种可能性是这个 EnableRaisingEvents 的 Task 本身还没有执行就要 Dispose,这个就需要处理了
gadfly3173
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request