1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Properly restoring include browser on application start, bug 215539.

This commit is contained in:
Markus Schorn 2008-01-29 09:41:29 +00:00
parent fabbd8d287
commit fb0f37db3e

View file

@ -652,9 +652,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
} }
public boolean isIndexerIdle() { public boolean isIndexerIdle() {
synchronized (fTaskQueueMutex) { return Job.getJobManager().find(this).length == 0;
return fCurrentTask == null && fTaskQueue.isEmpty();
}
} }
void addProject(final ICProject cproject) { void addProject(final ICProject cproject) {
@ -1008,45 +1006,6 @@ public class PDOMManager implements IWritableIndexManager, IListener {
} }
} }
public boolean joinIndexerOld(int waitMaxMillis, IProgressMonitor monitor) {
final int totalTicks = 1000;
monitor.beginTask(Messages.PDOMManager_JoinIndexerTask, totalTicks);
long limit= System.currentTimeMillis()+waitMaxMillis;
try {
int currentTicks= 0;
while (true) {
if (monitor.isCanceled()) {
return false;
}
currentTicks= getMonitorMessage(monitor, currentTicks, totalTicks);
synchronized(fTaskQueueMutex) {
if (isIndexerIdle()) {
return true;
}
int wait= 1000;
if (waitMaxMillis >= 0) {
int rest= (int) (limit - System.currentTimeMillis());
if (rest < wait) {
if (rest <= 0) {
return false;
}
wait= rest;
}
}
try {
fTaskQueueMutex.wait(wait);
} catch (InterruptedException e) {
return false;
}
}
}
}
finally {
monitor.done();
}
}
int getMonitorMessage(IProgressMonitor monitor, int currentTicks, int base) { int getMonitorMessage(IProgressMonitor monitor, int currentTicks, int base) {
assert !Thread.holdsLock(fTaskQueueMutex); assert !Thread.holdsLock(fTaskQueueMutex);
int remainingSources= 0; int remainingSources= 0;