'ApplicationListener.afterWriteActionFinished' to get notifications when all writes actions finished and write lock is released

CPP-7082 Cannot initiate symbols rebuild from writeAction in tests
CPP-7020 "Access is allowed from event dispatch thread only" after reload Cmake Project (master)
This commit is contained in:
Anton Makeev
2016-06-30 17:27:31 +02:00
parent cdf681b484
commit f8a4cf5704
3 changed files with 14 additions and 1 deletions
@@ -38,4 +38,7 @@ public abstract class ApplicationAdapter implements ApplicationListener {
@Override
public void writeActionFinished(@NotNull Object action) {
}
public void afterWriteActionFinished(@NotNull Object action) {
}
}
@@ -45,7 +45,12 @@ public interface ApplicationListener extends EventListener {
void writeActionStarted(@NotNull Object action);
/**
* Is called on action finish.
* Is called on before action finish, while while lock is still being hold
*/
void writeActionFinished(@NotNull Object action);
/**
* Is called after action finish and lock is released
*/
void afterWriteActionFinished(@NotNull Object action);
}
@@ -1122,6 +1122,7 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
}
if (myWriteActionsStack.isEmpty()) {
myLock.writeUnlock();
fireAfterWriteActionFinished(clazz);
}
}
}
@@ -1263,6 +1264,10 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
myDispatcher.getMulticaster().writeActionFinished(action);
}
private void fireAfterWriteActionFinished(@NotNull Class action) {
myDispatcher.getMulticaster().afterWriteActionFinished(action);
}
@Override
public void saveSettings() {
if (myDoNotSave) return;