aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_sleepqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_sleepqueue.c')
-rw-r--r--sys/kern/subr_sleepqueue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c
index 36f68505165d..1e50cc1814c4 100644
--- a/sys/kern/subr_sleepqueue.c
+++ b/sys/kern/subr_sleepqueue.c
@@ -293,8 +293,10 @@ sleepq_catch_signals(void *wchan)
struct sleepqueue *sq;
struct thread *td;
struct proc *p;
+ int do_upcall;
int sig;
+ do_upcall = 0;
td = curthread;
p = td->td_proc;
sc = SC_LOOKUP(wchan);
@@ -318,6 +320,8 @@ sleepq_catch_signals(void *wchan)
mtx_unlock(&p->p_sigacts->ps_mtx);
if (sig == 0 && thread_suspend_check(1))
sig = SIGSTOP;
+ else
+ do_upcall = thread_upcall_check(td);
PROC_UNLOCK(p);
/*
@@ -326,7 +330,7 @@ sleepq_catch_signals(void *wchan)
*/
sq = sleepq_lookup(wchan);
mtx_lock_spin(&sched_lock);
- if (TD_ON_SLEEPQ(td) && sig != 0) {
+ if (TD_ON_SLEEPQ(td) && (sig != 0 || do_upcall != 0)) {
mtx_unlock_spin(&sched_lock);
sleepq_wakeup_thread(sq, td, -1);
} else