diff options
3 files changed, 9 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java index 0aebc34da..f1acf7b96 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java @@ -697,6 +697,7 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit */ public Connection openConnection(IProgressMonitor monitor) throws CVSException { // Get the lock for the host to ensure that we are not connecting to the same host concurrently. + Policy.checkCanceled(monitor); ILock hostLock; synchronized(hostLocks) { hostLock = (ILock)hostLocks.get(getHost()); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java index b80f0a405..593169d7f 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java @@ -158,20 +158,22 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector impleme /* * Initialize the log entry handler and place it in the configuration */ - private LogEntryCacheUpdateHandler initializeLogEntryHandler(ISynchronizePageConfiguration configuration) { + private LogEntryCacheUpdateHandler initializeLogEntryHandler(final ISynchronizePageConfiguration configuration) { final LogEntryCacheUpdateHandler logEntryHandler = new LogEntryCacheUpdateHandler(configuration); configuration.setProperty(LOG_ENTRY_HANDLER, logEntryHandler); // Use an action group to get notified when the configuration is disposed configuration.addActionContribution(new SynchronizePageActionGroup() { public void dispose() { super.dispose(); - LogEntryCacheUpdateHandler handler = (LogEntryCacheUpdateHandler)getConfiguration().getProperty(LOG_ENTRY_HANDLER); + LogEntryCacheUpdateHandler handler = (LogEntryCacheUpdateHandler)configuration.getProperty(LOG_ENTRY_HANDLER); if (handler != null) { handler.shutdown(); - getConfiguration().setProperty(LOG_ENTRY_HANDLER, null); + configuration.setProperty(LOG_ENTRY_HANDLER, null); } } }); + // It is possible that the configuration has been disposed concurrently by another thread + // TODO return logEntryHandler; } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java index c907f6577..3b387cc41 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java @@ -212,6 +212,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler { * @see org.eclipse.team.internal.core.BackgroundEventHandler#processEvent(org.eclipse.team.internal.core.BackgroundEventHandler.Event, org.eclipse.core.runtime.IProgressMonitor) */ protected void processEvent(Event event, IProgressMonitor monitor) throws CoreException { + Policy.checkCanceled(monitor); switch (event.getType()) { case REMOVAL: case CHANGE: @@ -230,6 +231,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler { * @see org.eclipse.team.internal.core.BackgroundEventHandler#doDispatchEvents(org.eclipse.core.runtime.IProgressMonitor) */ protected boolean doDispatchEvents(IProgressMonitor monitor) throws TeamException { + Policy.checkCanceled(monitor); boolean dispatched = false; monitor.beginTask(null, 50); dispatched |= updateCache(Policy.subMonitorFor(monitor, 20)); @@ -432,6 +434,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler { monitor.setTaskName(CVSUIMessages.CVSChangeSetCollector_4); //$NON-NLS-1$ for (Iterator iter = projectMapping.values().iterator(); iter.hasNext();) { SyncInfoSet set = (SyncInfoSet) iter.next(); + Policy.checkCanceled(monitor); fetchLogEntries(logEntriesCache, set, Policy.subMonitorFor(monitor, 90)); fireFetchedNotification(logEntriesCache, set, Policy.subMonitorFor(monitor, 10)); } |