This commit is contained in:
Roman Shevchenko
2012-09-03 17:46:37 +04:00
parent 6cceb8af02
commit c5a30cc63d
2 changed files with 5 additions and 7 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,10 +57,10 @@ public class RefreshQueueImpl extends RefreshQueue {
}
else {
if (((ApplicationEx)application).holdsReadLock()) {
LOG.error( "Do not call synchronous refresh from inside read action except for event dispatch thread. This will eventually cause deadlock if there are events to fire");
LOG.error("Do not call synchronous refresh from inside read action except for event dispatch thread. " +
"This will eventually cause deadlock if there are any events to fire");
return;
}
queueSession(session, ModalityState.defaultModalityState());
session.waitFor();
}
@@ -41,14 +41,13 @@ public class RefreshSessionImpl extends RefreshSession {
private final boolean myIsAsync;
private final boolean myIsRecursive;
private final Runnable myFinishRunnable;
private final ModalityState myModalityState;
private final Semaphore mySemaphore = new Semaphore();
private List<VirtualFile> myWorkQueue = new ArrayList<VirtualFile>();
private List<VFileEvent> myEvents = new ArrayList<VFileEvent>();
private final Semaphore mySemaphore = new Semaphore();
private volatile boolean iHaveEventsToFire;
private final ModalityState myModalityState;
public RefreshSessionImpl(final boolean isAsync, final boolean recursively, final Runnable finishRunnable) {
this(isAsync, recursively, finishRunnable, ModalityState.NON_MODAL);
}
@@ -90,7 +89,6 @@ public class RefreshSessionImpl extends RefreshSession {
}
public void scan() {
// TODO: indicator in the status bar...
List<VirtualFile> workQueue = myWorkQueue;
myWorkQueue = new ArrayList<VirtualFile>();
boolean hasEventsToFire = myFinishRunnable != null || !myEvents.isEmpty();