cosmetics

This commit is contained in:
Eugene Zhuravlev
2009-11-11 13:27:31 +03:00
parent 31e1f10c8b
commit 083162bd6e
2 changed files with 4 additions and 4 deletions
@@ -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;