diff options
Diffstat (limited to 'sys/kern/kern_kthread.c')
-rw-r--r-- | sys/kern/kern_kthread.c | 17 |
1 files changed, 8 insertions, 9 deletions
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 <sys/sx.h> #include <sys/unistd.h> #include <sys/wait.h> -#include <sys/ksiginfo.h> #include <machine/stdarg.h> @@ -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); } |