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:
parent
38bd4a6094
commit
a23de8c133
1 changed files with 7 additions and 2 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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.CUIPlugin;
|
||||||
import org.eclipse.cdt.ui.IWorkingCopyManager;
|
import org.eclipse.cdt.ui.IWorkingCopyManager;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit;
|
||||||
|
|
||||||
|
|
||||||
public class CReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension {
|
public class CReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension {
|
||||||
|
|
||||||
|
@ -101,8 +103,11 @@ public class CReconcilingStrategy implements IReconcilingStrategy, IReconcilingS
|
||||||
if (ast == null || canceled) {
|
if (ast == null || canceled) {
|
||||||
((ICReconcilingListener)fEditor).reconciled(null, forced, fProgressMonitor);
|
((ICReconcilingListener)fEditor).reconciled(null, forced, fProgressMonitor);
|
||||||
} else {
|
} else {
|
||||||
synchronized (ast) {
|
((ASTTranslationUnit) ast).beginExclusiveAccess();
|
||||||
|
try {
|
||||||
((ICReconcilingListener)fEditor).reconciled(ast, forced, fProgressMonitor);
|
((ICReconcilingListener)fEditor).reconciled(ast, forced, fProgressMonitor);
|
||||||
|
} finally {
|
||||||
|
((ASTTranslationUnit) ast).endExclusiveAccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (canceled) {
|
if (canceled) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue