mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cosmetics
This commit is contained in:
@@ -178,7 +178,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
try {
|
||||
try {
|
||||
// disable up-to-date check to avoid locks on attempt to acquire index write lock while holding at the same time the readLock for this index
|
||||
FileBasedIndex.getInstance().disableUpToDateCheckForCurrentThread();
|
||||
FileBasedIndex.disableUpToDateCheckForCurrentThread();
|
||||
index.getReadLock().lock();
|
||||
final ValueContainer<TIntArrayList> container = index.getData(key);
|
||||
|
||||
@@ -257,7 +257,7 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
|
||||
}
|
||||
finally {
|
||||
index.getReadLock().unlock();
|
||||
FileBasedIndex.getInstance().enableUpToDateCheckForCurrentThread();
|
||||
FileBasedIndex.enableUpToDateCheckForCurrentThread();
|
||||
}
|
||||
}
|
||||
catch (StorageException e) {
|
||||
|
||||
@@ -528,12 +528,12 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
|
||||
private static final ThreadLocal<Integer> myUpToDateCheckState = new ThreadLocal<Integer>();
|
||||
|
||||
public void disableUpToDateCheckForCurrentThread() {
|
||||
public static void disableUpToDateCheckForCurrentThread() {
|
||||
final Integer currentValue = myUpToDateCheckState.get();
|
||||
myUpToDateCheckState.set(currentValue == null? 1 : currentValue.intValue() + 1);
|
||||
}
|
||||
|
||||
public void enableUpToDateCheckForCurrentThread() {
|
||||
public static void enableUpToDateCheckForCurrentThread() {
|
||||
final Integer currentValue = myUpToDateCheckState.get();
|
||||
if (currentValue != null) {
|
||||
final int newValue = currentValue.intValue() - 1;
|
||||
|
||||
Reference in New Issue
Block a user