1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 09:55:29 +02:00

Fix related to 173379, acquiring write lock in indexer task.

This commit is contained in:
Markus Schorn 2007-02-08 10:12:45 +00:00
parent 4a12afdf17
commit d09a32444e
3 changed files with 5 additions and 5 deletions

View file

@ -171,14 +171,14 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
project.accept(new TranslationUnitCollector(sources, headers, allFiles));
}
protected void removeTU(IWritableIndex index, ITranslationUnit tu) throws CoreException, InterruptedException {
index.acquireWriteLock(0);
protected void removeTU(IWritableIndex index, ITranslationUnit tu, int readlocks) throws CoreException, InterruptedException {
index.acquireWriteLock(readlocks);
try {
IIndexFragmentFile file = (IIndexFragmentFile) index.getFile(getIndexFileLocation(tu));
if (file != null)
index.clearFile(file);
} finally {
index.releaseWriteLock(0);
index.releaseWriteLock(readlocks);
}
}

View file

@ -46,7 +46,7 @@ class PDOMFastHandleDelta extends PDOMFastIndexerJob {
if (monitor.isCanceled())
return;
ITranslationUnit tu = (ITranslationUnit)i.next();
removeTU(index, tu);
removeTU(index, tu, 1);
if (tu.isSourceUnit()) {
fCompletedSources++;
}

View file

@ -61,7 +61,7 @@ class PDOMFullHandleDelta extends PDOMFullIndexerJob {
if (monitor.isCanceled())
return;
ITranslationUnit tu = (ITranslationUnit)i.next();
removeTU(index, tu);
removeTU(index, tu, 0);
if (tu.isSourceUnit()) {
fCompletedSources++;
}