mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-18 15:53:37 +00:00
Fix at least one of the things wrong with signals
^Z should work a lot better now. Submitted by: peter@freebsd.org
This commit is contained in:
parent
a83560d677
commit
55fb7ca894
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99480
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue