]> sourceware.org Git - newlib-cygwin.git/commitdiff
* sigproc.cc (wait_sig): Ensure that waiting threads are awoken after returning
authorChristopher Faylor <me@cgf.cx>
Sun, 12 Sep 2004 19:34:08 +0000 (19:34 +0000)
committerChristopher Faylor <me@cgf.cx>
Sun, 12 Sep 2004 19:34:08 +0000 (19:34 +0000)
from a hold condition.

winsup/cygwin/ChangeLog
winsup/cygwin/sigproc.cc

index db12169981151819ba8feeded515df3ddd8e5ebe..8c0a5aac37735de25e430fbefc5a55d8c13373bc 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-12  Christopher Faylor  <cgf@timesys.com>
+
+       * sigproc.cc (wait_sig): Ensure that waiting threads are awoken after
+       returning from a hold condition.
+
 2004-09-12  Christopher Faylor  <cgf@timesys.com>
 
        * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
index e9fec664355bc9b0537fe61a5df58c41129fc73c..2ab97698f750c792e3e62c93972fa107c8202477 100644 (file)
@@ -1139,6 +1139,7 @@ wait_sig (VOID *self)
        }
 
       sigpacket *q;
+      bool clearwait = false;
       switch (pack.si.si_signo)
        {
        case __SIGCOMMUNE:
@@ -1155,18 +1156,23 @@ wait_sig (VOID *self)
            if (myself->getsigmask () & (bit = SIGTOMASK (q->si.si_signo)))
              *pack.mask |= bit;
          break;
-       case __SIGFLUSH:
-       case __SIGFLUSHFAST:
-         sigq.reset ();
-         while ((q = sigq.next ()))
-           if (q->si.si_signo == __SIGDELETE || q->process () > 0)
-             sigq.del ();
-         break;
        case __SIGHOLD:
          holding_signals = 1;
          break;
        case __SIGNOHOLD:
          holding_signals = 0;
+         /* fall through, intentionally */
+       case __SIGFLUSH:
+       case __SIGFLUSHFAST:
+         sigq.reset ();
+         while ((q = sigq.next ()))
+           {
+             int sig = q->si.si_signo;
+             if (sig == __SIGDELETE || q->process () > 0)
+               sigq.del ();
+             if (sig == __SIGNOHOLD && q->si.si_signo == SIGCHLD)
+               clearwait = true;
+           }
          break;
        default:
          if (pack.si.si_signo < 0)
@@ -1191,10 +1197,12 @@ wait_sig (VOID *self)
                    }
                }
              if (sig == SIGCHLD)
-               proc_subproc (PROC_CLEARWAIT, 0);
+               clearwait = true;
            }
          break;
        }
+      if (clearwait)
+       proc_subproc (PROC_CLEARWAIT, 0);
       if (pack.wakeup)
        {
          SetEvent (pack.wakeup);
This page took 0.035279 seconds and 5 git commands to generate.