Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorJeff Johnston2018-07-17 14:45:21 -0400
committerJeff Johnston2018-07-17 14:45:21 -0400
commite0c656d2e035d71dc06587174469296ecd718026 (patch)
tree1f64811a8d4abd6f33a2fd38fbbeebd4de2f1841 /build
parent3ed176d0c273b7b5e4d2ad2bb7dd56166078f858 (diff)
downloadorg.eclipse.cdt-e0c656d2e035d71dc06587174469296ecd718026.tar.gz
org.eclipse.cdt-e0c656d2e035d71dc06587174469296ecd718026.tar.xz
org.eclipse.cdt-e0c656d2e035d71dc06587174469296ecd718026.zip
Bug 536413 - ConcurrentModificationException when indexing
- 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
Diffstat (limited to 'build')
-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 ff39a61a99..1799711fb0 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