1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

More robust handing of indexer cancellation.

Change-Id: I5c2baf7fab8560a0cc11bfc74994b6e9135e7cce
This commit is contained in:
Sergey Prigogin 2016-05-27 11:10:59 -07:00
parent 260b6dadac
commit a4cd53a926

View file

@ -127,6 +127,7 @@ public class PDOMIndexerJob extends Job {
sMonitorDetail= name;
}
};
do {
synchronized (taskMutex) {
currentTask= null;
@ -158,25 +159,30 @@ public class PDOMIndexerJob extends Job {
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (OperationCanceledException e) {
}
}
} while (currentTask != null);
return Status.OK_STATUS;
} catch (OperationCanceledException e) {
indexingAborted();
throw e;
} catch (RuntimeException | Error e) {
CCorePlugin.log(e);
pdomManager.cancelledIndexerJob(true);
synchronized (taskMutex) {
currentTask= null;
taskMutex.notifyAll();
}
indexingAborted();
throw e;
} finally {
synchronized (this) {
fMonitor= null;
}
monitorJob.cancel();
monitor.done();
}
}
private void indexingAborted() {
pdomManager.cancelledIndexerJob(true);
synchronized (taskMutex) {
currentTask= null;
taskMutex.notifyAll();
}
}