Skip to content

Commit bcf6c2c

Browse files
committed
Fix race with directory list on Windows.
1 parent c77201f commit bcf6c2c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkgs/watcher/lib/src/directory_watcher/windows.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ class _WindowsDirectoryWatcher
195195
}
196196

197197
/// The callback that's run when [Directory.watch] emits a batch of events.
198+
///
199+
/// This method must be fully synchronous or there will be races with ongoing
200+
/// newdirectory lists updating `_files`.
198201
void _onBatch(List<Event> batch) {
199202
_sortEvents(batch).forEach((path, eventSet) {
200203
var canonicalEvent = _canonicalEvent(eventSet);

0 commit comments

Comments
 (0)