1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

synchronize the building of the exe's list.

This commit is contained in:
Warren Paul 2008-04-24 20:46:22 +00:00
parent 2044602e4b
commit 0aa67427b4
2 changed files with 44 additions and 39 deletions

View file

@ -101,8 +101,10 @@ public class ExecutablesManager extends PlatformObject {
return Status.OK_STATUS;
}
ArrayList<Executable> oldList = executables;
executables = new ArrayList<Executable>();
synchronized (executables) {
ArrayList<Executable> oldList = new ArrayList<Executable>(executables);
executables.clear();
synchronized (executableProviders) {
monitor.beginTask("Refresh Executables", executableProviders.size());
for (IExecutableProvider provider : executableProviders) {
@ -118,6 +120,8 @@ public class ExecutablesManager extends PlatformObject {
});
}
}
}
return monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS;
}

View file

@ -123,6 +123,7 @@ public class StandardExecutableProvider implements IResourceChangeListener, ICPr
}
public Collection<Executable> getExecutables(IProgressMonitor monitor) {
synchronized (executables) {
executables.clear();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@ -159,7 +160,7 @@ public class StandardExecutableProvider implements IResourceChangeListener, ICPr
monitor.worked(1);
}
monitor.done();
}
return executables;
}