| Summary: | Race condition in AbstractHostShellOutputReader | ||
|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Vladimir Prus <vladimir.prus> |
| Component: | RSE | Assignee: | dsdp.tm.rse-inbox <tm.rse-inbox> |
| Status: | NEW --- | QA Contact: | Martin Oberhuber <mober.at+eclipse> |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Whiteboard: | |||
Ping? I might be wrong, but it seems that the presence of a problem, at least, is fairly obvious -- and it would be great to agree on that, before talking about patches. |
Build Identifier: This class has this code: protected final synchronized void startIfNotAlive() { if (!isAlive()) { start(); } } The problem is that isAlive() returns false both when the thread is not started yet, and when it's terminated. As result, I sometimes see situations where this method is called after the thread is terminated, and we get IllegalThreadStateException. The code on my client side is pretty boring: Object[] x = commands.runCommand(command, null, new SubProgressMonitor(monitor, 0)); IServiceCommandShell shell = (IServiceCommandShell)x[0]; IHostShell hostShell = shell.getHostShell(); Process runtimeProcess = new HostShellProcessAdapter(hostShell); Reproducible: Sometimes