diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java index c7f1d61dd34..70294f217df 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java @@ -202,27 +202,25 @@ abstract public class PDOMWriter { } index.acquireWriteLock(readlockCount); long start= System.currentTimeMillis(); + Throwable th= null; try { - Throwable th= null; - try { - storeFileInIndex(index, ifl, symbolMap, linkageID, configHash, contextIncludes); - } catch (RuntimeException e) { - th= e; - } catch (PDOMNotImplementedError e) { - th= e; - } catch (StackOverflowError e) { - th= e; - } - if (th != null) { - stati.add(createStatus(NLS.bind(Messages.PDOMWriter_errorWhileParsing, - ifl.getURI().getPath()), th)); - } - if (i < ifls.length - 1) { - updateFileCount(0, 0, 1); // update header count - } + storeFileInIndex(index, ifl, symbolMap, linkageID, configHash, contextIncludes); + } catch (RuntimeException e) { + th= e; + } catch (PDOMNotImplementedError e) { + th= e; + } catch (StackOverflowError e) { + th= e; } finally { index.releaseWriteLock(readlockCount, flushIndex); } + if (th != null) { + stati.add(createStatus(NLS.bind(Messages.PDOMWriter_errorWhileParsing, + ifl.getURI().getPath()), th)); + } + if (i < ifls.length - 1) { + updateFileCount(0, 0, 1); // update header count + } fStatistics.fAddToIndexTime+= System.currentTimeMillis() - start; } }