mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
bug 67001 - synchronize indexer job countdown, and only process job
cancel on tickdown
This commit is contained in:
parent
f4d51f7416
commit
e9f3066ac6
2 changed files with 5 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue