comparison src/w32proc.c @ 78726:bede1aa77f62

(delete_child): Don't terminate threads of zombies.
author Jason Rumney <jasonr@gnu.org>
date Sun, 02 Sep 2007 17:01:02 +0000
parents 922696f363b0
children 217ec3ada789 bdb3fe0ba9fa
comparison
equal deleted inserted replaced
78725:f19fc38690cc 78726:bede1aa77f62
214 if (GetExitCodeThread (cp->thrd, &rc) && rc == STILL_ACTIVE) 214 if (GetExitCodeThread (cp->thrd, &rc) && rc == STILL_ACTIVE)
215 { 215 {
216 /* let the thread exit cleanly if possible */ 216 /* let the thread exit cleanly if possible */
217 cp->status = STATUS_READ_ERROR; 217 cp->status = STATUS_READ_ERROR;
218 SetEvent (cp->char_consumed); 218 SetEvent (cp->char_consumed);
219 #if 0
220 /* We used to forceably terminate the thread here, but it
221 is normally unnecessary, and in abnormal cases, the worst that
222 will happen is we have an extra idle thread hanging around
223 waiting for the zombie process. */
219 if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0) 224 if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0)
220 { 225 {
221 DebPrint (("delete_child.WaitForSingleObject (thread) failed " 226 DebPrint (("delete_child.WaitForSingleObject (thread) failed "
222 "with %lu for fd %ld\n", GetLastError (), cp->fd)); 227 "with %lu for fd %ld\n", GetLastError (), cp->fd));
223 TerminateThread (cp->thrd, 0); 228 TerminateThread (cp->thrd, 0);
224 } 229 }
230 #endif
225 } 231 }
226 CloseHandle (cp->thrd); 232 CloseHandle (cp->thrd);
227 cp->thrd = NULL; 233 cp->thrd = NULL;
228 } 234 }
229 if (cp->char_avail) 235 if (cp->char_avail)