summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-09-12 19:34:08 +0000
committerChristopher Faylor <me@cgf.cx>2004-09-12 19:34:08 +0000
commita5eb75d60cc4e6f9d729505a3e54a721177d48c6 (patch)
tree95e721c0d77fd23ede45c38b79fec96b89368d2d /winsup
parent3d65bb97e8510a2b0d7d7d7474768feb43fcbf29 (diff)
downloadcygnal-a5eb75d60cc4e6f9d729505a3e54a721177d48c6.tar.gz
cygnal-a5eb75d60cc4e6f9d729505a3e54a721177d48c6.tar.bz2
cygnal-a5eb75d60cc4e6f9d729505a3e54a721177d48c6.zip
* sigproc.cc (wait_sig): Ensure that waiting threads are awoken after returning
from a hold condition.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/sigproc.cc24
2 files changed, 21 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index db1216998..8c0a5aac3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
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.
2004-09-11 Pierre Humblet <pierre.humblet@ieee.org>
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index e9fec6643..2ab97698f 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -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);