mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
bug 56411 - a request to index a project will restart a paused index
This commit is contained in:
parent
21c8756a37
commit
35b475be54
2 changed files with 14 additions and 7 deletions
|
@ -277,6 +277,11 @@ public class IndexManager extends JobManager implements IIndexConstants {
|
|||
boolean indexEnabled = isIndexEnabled(project);
|
||||
|
||||
if (indexEnabled){
|
||||
if( enabledState() == WAITING ){
|
||||
//if we are paused because the user cancelled a previous index, this is a good
|
||||
//enough reason to restart
|
||||
enable();
|
||||
}
|
||||
// check if the same request is not already in the queue
|
||||
IndexRequest request = new IndexAllProject(project, this);
|
||||
for (int i = this.jobEnd; i > this.jobStart; i--) // NB: don't check job at jobStart, as it may have already started (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=32488)
|
||||
|
|
|
@ -35,9 +35,9 @@ public abstract class JobManager implements Runnable {
|
|||
protected Thread thread;
|
||||
|
||||
/* flag indicating whether job execution is enabled or not */
|
||||
private static final int ENABLED = 1;
|
||||
private static final int DISABLED = 0;
|
||||
private static final int WAITING = 2;
|
||||
public static final int ENABLED = 1;
|
||||
public static final int DISABLED = 0;
|
||||
public static final int WAITING = 2;
|
||||
private int enabled = ENABLED;
|
||||
|
||||
public static boolean VERBOSE = false;
|
||||
|
@ -379,10 +379,12 @@ public abstract class JobManager implements Runnable {
|
|||
}
|
||||
awaitingJobs[jobEnd] = job;
|
||||
|
||||
if( indexJob == null ){
|
||||
indexJob = new IndexingJob( thread, this );
|
||||
} else {
|
||||
indexJob.tickUp();
|
||||
if( enabledState() == ENABLED ){
|
||||
if( indexJob == null ){
|
||||
indexJob = new IndexingJob( thread, this );
|
||||
} else {
|
||||
indexJob.tickUp();
|
||||
}
|
||||
}
|
||||
|
||||
if (VERBOSE)
|
||||
|
|
Loading…
Add table
Reference in a new issue