1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Improved reliability of indexer cancellation.

This commit is contained in:
Sergey Prigogin 2014-04-22 11:43:41 -07:00
parent 54fd5d6cd0
commit 5a5caee142

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2010 QNX Software Systems
* Copyright (c) 2005, 2014 QNX Software Systems
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
* Contributors:
* Doug Schaefer (QNX Software Systems) - initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom;
@ -140,7 +141,8 @@ public class PDOMIndexerJob extends Job {
System.out.println("Indexer: completed " + name + "[" + time + "ms]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
// An interrupt cancels the current task.
Thread.interrupted(); // Clear interrupted status.
} catch (OperationCanceledException e) {
}
}
@ -198,7 +200,15 @@ public class PDOMIndexerJob extends Job {
}
}
}
@Override
protected void canceling() {
Thread currThread = getThread();
if (currThread != null) {
currThread.interrupt();
}
}
@Override
public boolean belongsTo(Object family) {
return family == pdomManager;