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

More granular index locking.

This commit is contained in:
Sergey Prigogin 2009-10-25 20:38:57 +00:00
parent ab5b237d74
commit 4cd1523cc1

View file

@ -202,7 +202,6 @@ abstract public class PDOMWriter {
} }
index.acquireWriteLock(readlockCount); index.acquireWriteLock(readlockCount);
long start= System.currentTimeMillis(); long start= System.currentTimeMillis();
try {
Throwable th= null; Throwable th= null;
try { try {
storeFileInIndex(index, ifl, symbolMap, linkageID, configHash, contextIncludes); storeFileInIndex(index, ifl, symbolMap, linkageID, configHash, contextIncludes);
@ -212,6 +211,8 @@ abstract public class PDOMWriter {
th= e; th= e;
} catch (StackOverflowError e) { } catch (StackOverflowError e) {
th= e; th= e;
} finally {
index.releaseWriteLock(readlockCount, flushIndex);
} }
if (th != null) { if (th != null) {
stati.add(createStatus(NLS.bind(Messages.PDOMWriter_errorWhileParsing, stati.add(createStatus(NLS.bind(Messages.PDOMWriter_errorWhileParsing,
@ -220,9 +221,6 @@ abstract public class PDOMWriter {
if (i < ifls.length - 1) { if (i < ifls.length - 1) {
updateFileCount(0, 0, 1); // update header count updateFileCount(0, 0, 1); // update header count
} }
} finally {
index.releaseWriteLock(readlockCount, flushIndex);
}
fStatistics.fAddToIndexTime+= System.currentTimeMillis() - start; fStatistics.fAddToIndexTime+= System.currentTimeMillis() - start;
} }
} }