From eaea211c367d24d7863c5e5d50963f054e929499 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Tue, 19 Jun 2012 17:20:47 +0200 Subject: [PATCH] ensure initialized state is visible to other threads --- .../src/com/intellij/util/indexing/FileBasedIndexImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java index cfcc046a8114..1f9d4ec28e88 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java @@ -125,7 +125,7 @@ public class FileBasedIndexImpl extends FileBasedIndex { @Nullable private ScheduledFuture myFlushingFuture; private volatile int myLocalModCount; private volatile int myFilesModCount; - + private volatile boolean myInitialized; // need this variable for memory barrier @Override public void requestReindex(@NotNull final VirtualFile file) { myChangedFilesCollector.invalidateIndices(file, true); @@ -347,7 +347,7 @@ public class FileBasedIndexImpl extends FileBasedIndex { lastModCount = myLocalModCount; } }); - + myInitialized = true; // this will ensure that all changes to component's state will be visible to other threads } }