mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ensure initialized state is visible to other threads
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user