1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

More granular index locking. Bug 287907.

This commit is contained in:
Sergey Prigogin 2009-10-25 06:01:55 +00:00
parent 90a3287885
commit ab5b237d74

View file

@ -191,18 +191,18 @@ abstract public class PDOMWriter {
int linkageID, int configHash, HashSet<IASTPreprocessorIncludeStatement> contextIncludes,
IWritableIndex index, int readlockCount, boolean flushIndex,
ArrayList<IStatus> stati, IProgressMonitor pm) throws InterruptedException, CoreException {
index.acquireWriteLock(readlockCount);
long start= System.currentTimeMillis();
try {
for (int i= 0; i < ifls.length; i++) {
if (pm.isCanceled())
return;
for (int i= 0; i < ifls.length; i++) {
if (pm.isCanceled())
return;
final IIndexFileLocation ifl= ifls[i];
if (ifl != null) {
if (fShowActivity) {
System.out.println("Indexer: adding " + ifl.getURI()); //$NON-NLS-1$
}
final IIndexFileLocation ifl= ifls[i];
if (ifl != null) {
if (fShowActivity) {
System.out.println("Indexer: adding " + ifl.getURI()); //$NON-NLS-1$
}
index.acquireWriteLock(readlockCount);
long start= System.currentTimeMillis();
try {
Throwable th= null;
try {
storeFileInIndex(index, ifl, symbolMap, linkageID, configHash, contextIncludes);
@ -220,12 +220,12 @@ abstract public class PDOMWriter {
if (i < ifls.length - 1) {
updateFileCount(0, 0, 1); // update header count
}
} finally {
index.releaseWriteLock(readlockCount, flushIndex);
}
fStatistics.fAddToIndexTime+= System.currentTimeMillis() - start;
}
} finally {
index.releaseWriteLock(readlockCount, flushIndex);
}
fStatistics.fAddToIndexTime+= System.currentTimeMillis()-start;
}
private void resolveNames(final Map<IIndexFileLocation, Symbols> symbolMap, IIndexFileLocation[] ifls,