From: cgf AT cygnus DOT com (Christopher Faylor) Subject: Patch to alleviate wait function problems 15 Jul 1998 09:11:06 -0700 Message-ID: <199807151551.LAA01031.cygnus.cygwin32.developers@kramden.cygnus.com> To: cygwin32-developers AT cygnus DOT com, sos AT prospect DOT com DOT ru There is a problem with wait() and signals that has been noticed on the mailing list from time to time. Specifically, if you are in the middle of a wait and have a SIGCHLD handler which performs a wait, and then returns to the previous wait, the previous wait may block forever. The patch below should fix this. Sergey, if you have the time, would you mind putting this patch into a "coolview" release? I'd be very interested in finding out if this solves any problems (or breaks anything). -Chris Index: wait.cc =================================================================== RCS file: /cvs/cvsfiles/devo/winsup/wait.cc,v retrieving revision 1.36.2.1 diff -u -r1.36.2.1 wait.cc --- wait.cc 1998/06/06 05:50:25 1.36.2.1 +++ wait.cc 1998/07/15 15:42:54 @@ -113,5 +113,6 @@ w->status = -1; if (rc < 0) sigproc_printf("*** errno = %d\n", get_errno()); + SetEvent (w->thread_ev); // in case invoked recursively via a signal return rc; }