mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
low memory flusher doesn't wait for write lock if it can not be taken at the moment (WEB-23202)
This commit is contained in:
@@ -82,11 +82,13 @@ public class MapReduceIndex<Key, Value, Input> implements UpdatableIndex<Key,Val
|
||||
public void run() {
|
||||
try {
|
||||
if (myStorage instanceof MemoryIndexStorage) {
|
||||
getWriteLock().lock();
|
||||
try {
|
||||
((MemoryIndexStorage<Key, Value>)myStorage).clearCaches();
|
||||
} finally {
|
||||
getWriteLock().unlock();
|
||||
Lock writeLock = getWriteLock();
|
||||
if (writeLock.tryLock()) {
|
||||
try {
|
||||
((MemoryIndexStorage<Key, Value>)myStorage).clearCaches();
|
||||
} finally {
|
||||
writeLock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
flush();
|
||||
|
||||
Reference in New Issue
Block a user