Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-07-17 18:45:21 +0000
committerJeff Johnston2018-07-17 20:21:10 +0000
commitf90f1e2cd87f4cba06de8dbb3557ca78c6da276d (patch)
tree9c9feed5da4f1a8ae37089739265ae70189d6a9f
parent5f449f8a4caebacecd2acedc1015f39d089223e0 (diff)
downloadorg.eclipse.cdt-CDT_9_5_2.tar.gz
org.eclipse.cdt-CDT_9_5_2.tar.xz
org.eclipse.cdt-CDT_9_5_2.zip
Bug 536413 - ConcurrentModificationException when indexingCDT_9_5_2
- apply patch submitted by duh-sa-sekirom@hotmail.com - in GCCToolChain join the threads that do include path and macro searches before waiting for process so as to prevent a ConcurrentModificationException Change-Id: Iefe6f013007b7bbf00117b5295b5e27489a72834 (cherry picked from commit e0c656d2e035d71dc06587174469296ecd718026)
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
index ff39a61a99b..1799711fb02 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
@@ -467,7 +467,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
Pattern definePattern = Pattern.compile("#define ([^\\s]*)\\s(.*)"); //$NON-NLS-1$
// First the include path off the error stream
- new Thread("Include Path Reader") {
+ Thread includePathReaderThread = new Thread("Include Path Reader") {
@Override
public void run() {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
@@ -493,9 +493,10 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
CCorePlugin.log(e);
}
}
- }.start();
+ };
+ includePathReaderThread.start();
- new Thread("Macro reader") {
+ Thread macroReaderThread = new Thread("Macro reader") {
public void run() {
// Now the defines off the output stream
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
@@ -511,9 +512,12 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
CCorePlugin.log(e);
}
}
- }.start();
+ };
+ macroReaderThread.start();
try {
+ includePathReaderThread.join();
+ macroReaderThread.join();
process.waitFor();
} catch (InterruptedException e) {
Activator.log(e);

Back to the top