[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Spawner.java patch
|
If user click Cancel button in progress dialog, the following sequence of
events happens:
- kill application
- close handle
- drain pipes
Actually this sometimes causes hanging of IDE (at least in Windows) in case
if process is blocked on the pipe reading. Killing of application (at least
this is correct for make) leaves process to be blocked on reading forever.
It is better to change the order:
- close handle
- kill application
Handle closing breaks blocked read operation.
Index: Spawner.java
===================================================================
RCS file:
/home/tools/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/spawner/Spawner
.java,v
retrieving revision 1.6
diff -u -r1.6 Spawner.java
--- Spawner.java 24 Apr 2003 14:23:27 -0000 1.6
+++ Spawner.java 15 Jul 2003 13:29:07 -0000
@@ -144,8 +144,6 @@
* See java.lang.Process#destroy ();
**/
public synchronized void destroy() {
- // Sends the TERM
- terminate();
// Close the streams on this side.
try {
((SpawnerInputStream)getErrorStream()).close();
@@ -153,6 +151,8 @@
((SpawnerOutputStream)getOutputStream()).close();
} catch (IOException e) {
}
+ // Sends the TERM
+ terminate();
// Grace before using the heavy gone.
if (!isDone) {
try {