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:
parent
260b6dadac
commit
a4cd53a926
1 changed files with 13 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue