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

Bug 343948 - Shared ast is exposed for concurrent usage

This commit is contained in:
Anton Leherbauer 2011-05-02 07:52:10 +00:00
parent 38bd4a6094
commit a23de8c133

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2009 IBM Corporation and others.
* Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -30,6 +30,8 @@ import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IWorkingCopyManager;
import org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit;
public class CReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension {
@ -101,8 +103,11 @@ public class CReconcilingStrategy implements IReconcilingStrategy, IReconcilingS
if (ast == null || canceled) {
((ICReconcilingListener)fEditor).reconciled(null, forced, fProgressMonitor);
} else {
synchronized (ast) {
((ASTTranslationUnit) ast).beginExclusiveAccess();
try {
((ICReconcilingListener)fEditor).reconciled(ast, forced, fProgressMonitor);
} finally {
((ASTTranslationUnit) ast).endExclusiveAccess();
}
}
if (canceled) {