mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
This commit is contained in:
@@ -56,12 +56,13 @@ public class PeriodicalTasksCloser implements ProjectManagerListener {
|
||||
return ServiceManager.getService(project, PeriodicalTasksCloser.class);
|
||||
}
|
||||
|
||||
public void register(final String name, final Runnable runnable) {
|
||||
public boolean register(final String name, final Runnable runnable) {
|
||||
synchronized (ourLock) {
|
||||
if (Boolean.FALSE.equals(myStates.get(myProject))) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
myInterrupters.add(new Pair<String, Runnable>(name, runnable));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public class SlowlyClosingAlarm implements AtomicSectionsAware, Disposable {
|
||||
myLock = new Object();
|
||||
myFutureList = new ArrayList<Future<?>>();
|
||||
Disposer.register(project, this);
|
||||
PeriodicalTasksCloser.getInstance(project).register(name, new Runnable() {
|
||||
myDisposeStarted = ! PeriodicalTasksCloser.getInstance(project).register(name, new Runnable() {
|
||||
public void run() {
|
||||
waitAndInterrupt(ProgressManager.getInstance().getProgressIndicator());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user