mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
Cosmetics.
This commit is contained in:
parent
6ae45784a5
commit
6f0c54eb86
1 changed files with 13 additions and 20 deletions
|
@ -93,13 +93,13 @@ public class PDOMIndexerJob extends Job {
|
||||||
IProgressMonitor npm= new NullProgressMonitor() {
|
IProgressMonitor npm= new NullProgressMonitor() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isCanceled() {
|
public boolean isCanceled() {
|
||||||
synchronized(PDOMIndexerJob.this) {
|
synchronized (PDOMIndexerJob.this) {
|
||||||
return fMonitor == null || fMonitor.isCanceled();
|
return fMonitor == null || fMonitor.isCanceled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void setCanceled(boolean cancelled) {
|
public void setCanceled(boolean cancelled) {
|
||||||
synchronized(PDOMIndexerJob.this) {
|
synchronized (PDOMIndexerJob.this) {
|
||||||
if (fMonitor != null) {
|
if (fMonitor != null) {
|
||||||
fMonitor.setCanceled(cancelled);
|
fMonitor.setCanceled(cancelled);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class PDOMIndexerJob extends Job {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
do {
|
do {
|
||||||
synchronized(taskMutex) {
|
synchronized (taskMutex) {
|
||||||
currentTask= null;
|
currentTask= null;
|
||||||
taskMutex.notifyAll();
|
taskMutex.notifyAll();
|
||||||
|
|
||||||
|
@ -139,18 +139,14 @@ public class PDOMIndexerJob extends Job {
|
||||||
time += System.currentTimeMillis();
|
time += System.currentTimeMillis();
|
||||||
System.out.println("Indexer: completed " + name + "[" + time + "ms]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
System.out.println("Indexer: completed " + name + "[" + time + "ms]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
}
|
} catch (InterruptedException e) {
|
||||||
catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
} catch (OperationCanceledException e) {
|
||||||
catch (OperationCanceledException e) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (currentTask != null);
|
||||||
while (currentTask != null);
|
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
} catch (RuntimeException e) {
|
||||||
catch (RuntimeException e) {
|
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
pdomManager.cancelledIndexerJob(true);
|
pdomManager.cancelledIndexerJob(true);
|
||||||
synchronized (taskMutex) {
|
synchronized (taskMutex) {
|
||||||
|
@ -158,8 +154,7 @@ public class PDOMIndexerJob extends Job {
|
||||||
taskMutex.notifyAll();
|
taskMutex.notifyAll();
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
} catch (Error e) {
|
||||||
catch (Error e) {
|
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
pdomManager.cancelledIndexerJob(true);
|
pdomManager.cancelledIndexerJob(true);
|
||||||
synchronized (taskMutex) {
|
synchronized (taskMutex) {
|
||||||
|
@ -167,9 +162,8 @@ public class PDOMIndexerJob extends Job {
|
||||||
taskMutex.notifyAll();
|
taskMutex.notifyAll();
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
} finally {
|
||||||
finally {
|
synchronized (this) {
|
||||||
synchronized(this) {
|
|
||||||
fMonitor= null;
|
fMonitor= null;
|
||||||
}
|
}
|
||||||
monitorJob.cancel();
|
monitorJob.cancel();
|
||||||
|
@ -179,15 +173,14 @@ public class PDOMIndexerJob extends Job {
|
||||||
|
|
||||||
private String getClassName(Object obj) {
|
private String getClassName(Object obj) {
|
||||||
String name= obj.getClass().getName();
|
String name= obj.getClass().getName();
|
||||||
name= name.substring(name.lastIndexOf('.')+1);
|
name= name.substring(name.lastIndexOf('.') + 1);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelJobs(IPDOMIndexer indexer, boolean waitUntilCancelled) {
|
public void cancelJobs(IPDOMIndexer indexer, boolean waitUntilCancelled) {
|
||||||
synchronized (taskMutex) {
|
synchronized (taskMutex) {
|
||||||
if (currentTask != null &&
|
if (currentTask != null && (indexer == null || currentTask.getIndexer() == indexer)) {
|
||||||
(indexer == null || currentTask.getIndexer() == indexer)) {
|
synchronized (this) {
|
||||||
synchronized(this) {
|
|
||||||
if (fMonitor != null) {
|
if (fMonitor != null) {
|
||||||
fMonitor.setCanceled(true);
|
fMonitor.setCanceled(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue