1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 02:36:01 +02:00

bug 67001 - synchronize indexer job countdown, and only process job

cancel on tickdown
This commit is contained in:
Andrew Niefer 2004-06-14 18:21:28 +00:00
parent f4d51f7416
commit e9f3066ac6
2 changed files with 5 additions and 9 deletions

View file

@ -61,18 +61,14 @@ public class IndexingJob extends Job {
return ASYNC_FINISH;
}
public void tickUp(){
if( progressMonitor != null && progressMonitor.isCanceled() ){
jobManager.pause();
return;
}
synchronized public void tickUp(){
ticks++;
if( ticks > maxTicks )
maxTicks = ticks;
updateRemainingCount( null );
}
public void setTicks( int n ){
synchronized public void setTicks( int n ){
ticks = n;
if( maxTicks < ticks )
maxTicks = ticks;
@ -81,7 +77,7 @@ public class IndexingJob extends Job {
updateRemainingCount( null );
}
public int tickDown( String str ){
synchronized public int tickDown( String str ){
if( progressMonitor != null && progressMonitor.isCanceled() ){
jobManager.pause();
return 0;

View file

@ -150,7 +150,7 @@ public abstract class JobManager implements Runnable {
JobManager.verbose("-> discarding background job - " + currentJob); //$NON-NLS-1$
currentJob.cancel();
if( indexJob != null ){
if( indexJob.tickDown( null ) == 0 ){
if( indexJob.tickDown( null ) <= 0 ){
indexJob.done( OK_STATUS );
indexJob = null;
}
@ -211,7 +211,7 @@ public abstract class JobManager implements Runnable {
progressString += job.toString();
progressString += ")"; //$NON-NLS-1$
}
if( indexJob.tickDown( progressString ) == 0 ){
if( indexJob.tickDown( progressString ) <= 0 ){
indexJob.done( OK_STATUS );
indexJob = null;
}