summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_kthread.c
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-10-01 17:15:53 +0000
committerjmallett <jmallett@FreeBSD.org>2002-10-01 17:15:53 +0000
commit7a693db242641440dad298d332b3cc5a4c88f8f4 (patch)
tree07d2fcfbfe85d84af8cf79f8fec57733afa19e18 /sys/kern/kern_kthread.c
parentb5dfcc0b31407d0d79c551549f16736d600e350a (diff)
downloadFreeBSD-src-7a693db242641440dad298d332b3cc5a4c88f8f4.zip
FreeBSD-src-7a693db242641440dad298d332b3cc5a4c88f8f4.tar.gz
Back our kernel support for reliable signal queues.
Requested by: rwatson, phk, and many others
Diffstat (limited to 'sys/kern/kern_kthread.c')
-rw-r--r--sys/kern/kern_kthread.c17
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);
}
OpenPOWER on IntegriCloud