mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Bug 540085 - Deadlock in ToolChainManager init
- modify ContainerGCCToolChainProvider.init so that the CBuildConfigurationManager.recheckConfigs() call is done within a separate job so the init() call will return without causing deadlock - do the same for ContainerTargetTypeProvider - modify CBuildConfigurationManager initProviders() method to be synchronized Change-Id: I4ca9371fb340887233872b6d315621a24450fb2b
This commit is contained in:
parent
efbda46cba
commit
c9eee479b4
3 changed files with 39 additions and 14 deletions
|
@ -101,7 +101,7 @@ public class CBuildConfigurationManager implements ICBuildConfigurationManager,
|
||||||
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
|
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initProviders() {
|
private synchronized void initProviders() {
|
||||||
if (providers == null) {
|
if (providers == null) {
|
||||||
providers = new HashMap<>();
|
providers = new HashMap<>();
|
||||||
|
|
||||||
|
|
|
@ -123,12 +123,25 @@ public class ContainerTargetTypeProvider
|
||||||
DockerConnectionManager.getInstance()
|
DockerConnectionManager.getInstance()
|
||||||
.addConnectionManagerListener(this);
|
.addConnectionManagerListener(this);
|
||||||
|
|
||||||
// call the recheckConfigs method in case any disabled targets are now
|
// re-check configs in case an enabled Connection has made old configs
|
||||||
// ok
|
// valid again do this in a separate job to prevent a possible
|
||||||
ICBuildConfigurationManager mgr = CCorePlugin
|
// deadlock trying to get the lock on the CBuildConfigurationManager
|
||||||
.getService(ICBuildConfigurationManager.class);
|
// "configs" map (Bug 540085)
|
||||||
ICBuildConfigurationManager2 manager = (ICBuildConfigurationManager2) mgr;
|
Job checkConfigs = new Job("Check configs") { //$NON-NLS-1$
|
||||||
manager.recheckConfigs();
|
@Override
|
||||||
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
// call the recheckConfigs method in case any disabled targets
|
||||||
|
// are now
|
||||||
|
// ok
|
||||||
|
ICBuildConfigurationManager mgr = CCorePlugin
|
||||||
|
.getService(ICBuildConfigurationManager.class);
|
||||||
|
ICBuildConfigurationManager2 cbuildmanager = (ICBuildConfigurationManager2) mgr;
|
||||||
|
cbuildmanager.recheckConfigs();
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
checkConfigs.setUser(true);
|
||||||
|
checkConfigs.schedule();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
launchbarManager.setActiveLaunchTarget(defaultTarget);
|
launchbarManager.setActiveLaunchTarget(defaultTarget);
|
||||||
|
|
|
@ -98,13 +98,25 @@ public class ContainerGCCToolChainProvider
|
||||||
DockerConnectionManager.getInstance()
|
DockerConnectionManager.getInstance()
|
||||||
.addConnectionManagerListener(this);
|
.addConnectionManagerListener(this);
|
||||||
|
|
||||||
// call the recheckConfigs method in case any disabled targets are now
|
// re-check configs in case an enabled Connection has made old configs
|
||||||
// ok
|
// valid again do this in a separate job to prevent a possible
|
||||||
ICBuildConfigurationManager mgr = CCorePlugin
|
// deadlock trying to get the lock on the CBuildConfigurationManager
|
||||||
.getService(ICBuildConfigurationManager.class);
|
// "configs" map (Bug 540085)
|
||||||
ICBuildConfigurationManager2 cbuildmanager = (ICBuildConfigurationManager2) mgr;
|
Job checkConfigs = new Job("Check configs") { //$NON-NLS-1$
|
||||||
cbuildmanager.recheckConfigs();
|
@Override
|
||||||
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
// call the recheckConfigs method in case any disabled targets
|
||||||
|
// are now
|
||||||
|
// ok
|
||||||
|
ICBuildConfigurationManager mgr = CCorePlugin
|
||||||
|
.getService(ICBuildConfigurationManager.class);
|
||||||
|
ICBuildConfigurationManager2 cbuildmanager = (ICBuildConfigurationManager2) mgr;
|
||||||
|
cbuildmanager.recheckConfigs();
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
checkConfigs.setUser(true);
|
||||||
|
checkConfigs.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue