From 0dd222cc84c442c06e5d754e85741d9556f749cd Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Thu, 7 Oct 2010 11:19:31 +0400 Subject: [PATCH] thread safety --- .../src/com/intellij/openapi/project/CacheUpdateRunner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java index 275328fbb10f..c3864ef3a44a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java @@ -33,6 +33,7 @@ import com.intellij.util.Consumer; import gnu.trove.THashSet; import java.util.Collection; +import java.util.Collections; import java.util.Set; class CacheUpdateRunner { @@ -72,7 +73,7 @@ class CacheUpdateRunner { Consumer progressUpdater = new Consumer() { // need set here to handle queue.pushbacks after checkCancelled() in order // not to count the same file several times - final Set processed = new THashSet(); + final Set processed = Collections.synchronizedSet(new THashSet()); public void consume(VirtualFile virtualFile) { indicator.checkCanceled();