Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2489)

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2924943005: Make a copy of files to invalidate to avoid concurrent modifications. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index 499e3fa70f8921c770e653756b2e672e57925aa4..3a23501b1d694ef00a532fa51be769e0dadaf677 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -282,14 +282,18 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
/// Refresh all the invalidated files and update dependencies.
Future<Null> _refreshInvalidatedFiles() async {
await _logger.runAsync('Refresh invalidated files', () async {
- for (var fileUri in _invalidatedFiles) {
+ // Create a copy to avoid concurrent modifications.
+ var invalidatedFiles = _invalidatedFiles.toList();
+ _invalidatedFiles.clear();
+
+ // Refresh the files.
+ for (var fileUri in invalidatedFiles) {
var file = _fsState.getFileByFileUri(fileUri);
if (file != null) {
_logger.writeln('Refresh $fileUri');
await file.refresh();
}
}
- _invalidatedFiles.clear();
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698