From 7a693db242641440dad298d332b3cc5a4c88f8f4 Mon Sep 17 00:00:00 2001 From: jmallett Date: Tue, 1 Oct 2002 17:15:53 +0000 Subject: Back our kernel support for reliable signal queues. Requested by: rwatson, phk, and many others --- sys/kern/kern_kthread.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'sys/kern/kern_kthread.c') diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 95e9a68..08ef71f 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -37,7 +37,6 @@ #include #include #include -#include #include @@ -145,16 +144,16 @@ kthread_suspend(struct proc *p, int timo) { /* * Make sure this is indeed a system process and we can safely - * use the signal queue. + * use the p_siglist field. */ PROC_LOCK(p); if ((p->p_flag & P_KTHREAD) == 0) { PROC_UNLOCK(p); return (EINVAL); } - signal_add(p, NULL, SIGSTOP); + SIGADDSET(p->p_siglist, SIGSTOP); wakeup(p); - return msleep(&p->p_sigq, &p->p_mtx, PPAUSE | PDROP, "suspkt", timo); + return msleep(&p->p_siglist, &p->p_mtx, PPAUSE | PDROP, "suspkt", timo); } int @@ -169,9 +168,9 @@ kthread_resume(struct proc *p) PROC_UNLOCK(p); return (EINVAL); } - signal_delete(p, NULL, SIGSTOP); + SIGDELSET(p->p_siglist, SIGSTOP); PROC_UNLOCK(p); - wakeup(&p->p_sigq); + wakeup(&p->p_siglist); return (0); } @@ -179,9 +178,9 @@ void kthread_suspend_check(struct proc *p) { PROC_LOCK(p); - while (signal_queued(p, SIGSTOP)) { - wakeup(&p->p_sigq); - msleep(&p->p_sigq, &p->p_mtx, PPAUSE, "ktsusp", 0); + while (SIGISMEMBER(p->p_siglist, SIGSTOP)) { + wakeup(&p->p_siglist); + msleep(&p->p_siglist, &p->p_mtx, PPAUSE, "ktsusp", 0); } PROC_UNLOCK(p); } -- cgit v1.1