summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-07-06 02:45:11 +0000
committerjulian <julian@FreeBSD.org>2002-07-06 02:45:11 +0000
commit7e464b4d342c2fd8a2db4aae889accfc5db01bb9 (patch)
treea313dfb07e389c5b8191c09a8dbc086c99ff4e04 /sys/kern/kern_synch.c
parentd7244e2c6d67b7d87add45a7801dcfe97f6a3dd4 (diff)
downloadFreeBSD-src-7e464b4d342c2fd8a2db4aae889accfc5db01bb9.zip
FreeBSD-src-7e464b4d342c2fd8a2db4aae889accfc5db01bb9.tar.gz
Fix at least one of the things wrong with signals
^Z should work a lot better now. Submitted by: peter@freebsd.org
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 540e8a9..79a6dfa 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -536,9 +536,11 @@ msleep(ident, mtx, priority, wmesg, timo)
mtx_unlock_spin(&sched_lock);
PROC_LOCK(p);
sig = cursig(td);
- if (thread_suspend_check(1)) {
- sig = EINTR;
- rval = EINTR;
+ if (sig == 0) {
+ if (thread_suspend_check(1)) {
+ sig = SIGSTOP;
+ rval = ERESTART;
+ }
}
mtx_lock_spin(&sched_lock);
PROC_UNLOCK(p);
@@ -547,8 +549,9 @@ msleep(ident, mtx, priority, wmesg, timo)
unsleep(td);
} else if (td->td_wchan == NULL)
catch = 0;
- } else
+ } else {
sig = 0;
+ }
if (td->td_wchan != NULL) {
p->p_stats->p_ru.ru_nvcsw++;
td->td_state = TDS_SLP;
@@ -562,9 +565,9 @@ msleep(ident, mtx, priority, wmesg, timo)
td->td_flags &= ~TDF_TIMEOUT;
if (sig == 0)
rval = EWOULDBLOCK;
- } else if (td->td_flags & TDF_TIMOFAIL)
+ } else if (td->td_flags & TDF_TIMOFAIL) {
td->td_flags &= ~TDF_TIMOFAIL;
- else if (timo && callout_stop(&td->td_slpcallout) == 0) {
+ } else if (timo && callout_stop(&td->td_slpcallout) == 0) {
/*
* This isn't supposed to be pretty. If we are here, then
* the endtsleep() callout is currently executing on another
OpenPOWER on IntegriCloud