mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +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;
|
sMonitorDetail= name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
do {
|
do {
|
||||||
synchronized (taskMutex) {
|
synchronized (taskMutex) {
|
||||||
currentTask= null;
|
currentTask= null;
|
||||||
|
@ -158,25 +159,30 @@ public class PDOMIndexerJob extends Job {
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
} catch (OperationCanceledException e) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (currentTask != null);
|
} while (currentTask != null);
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
|
} catch (OperationCanceledException e) {
|
||||||
|
indexingAborted();
|
||||||
|
throw e;
|
||||||
} catch (RuntimeException | Error e) {
|
} catch (RuntimeException | Error e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
pdomManager.cancelledIndexerJob(true);
|
indexingAborted();
|
||||||
synchronized (taskMutex) {
|
|
||||||
currentTask= null;
|
|
||||||
taskMutex.notifyAll();
|
|
||||||
}
|
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
fMonitor= null;
|
fMonitor= null;
|
||||||
}
|
}
|
||||||
monitorJob.cancel();
|
monitorJob.cancel();
|
||||||
monitor.done();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void indexingAborted() {
|
||||||
|
pdomManager.cancelledIndexerJob(true);
|
||||||
|
synchronized (taskMutex) {
|
||||||
|
currentTask= null;
|
||||||
|
taskMutex.notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue