mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
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
This commit is contained in:
parent
3ed176d0c2
commit
e0c656d2e0
1 changed files with 8 additions and 4 deletions
|
@ -467,7 +467,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
|
||||||
Pattern definePattern = Pattern.compile("#define ([^\\s]*)\\s(.*)"); //$NON-NLS-1$
|
Pattern definePattern = Pattern.compile("#define ([^\\s]*)\\s(.*)"); //$NON-NLS-1$
|
||||||
|
|
||||||
// First the include path off the error stream
|
// First the include path off the error stream
|
||||||
new Thread("Include Path Reader") {
|
Thread includePathReaderThread = new Thread("Include Path Reader") {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
|
||||||
|
@ -493,9 +493,10 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
};
|
||||||
|
includePathReaderThread.start();
|
||||||
|
|
||||||
new Thread("Macro reader") {
|
Thread macroReaderThread = new Thread("Macro reader") {
|
||||||
public void run() {
|
public void run() {
|
||||||
// Now the defines off the output stream
|
// Now the defines off the output stream
|
||||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
|
||||||
|
@ -511,9 +512,12 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
};
|
||||||
|
macroReaderThread.start();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
includePathReaderThread.join();
|
||||||
|
macroReaderThread.join();
|
||||||
process.waitFor();
|
process.waitFor();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
|
|
Loading…
Add table
Reference in a new issue