summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-03-21 08:23:25 +0000
committerjeff <jeff@FreeBSD.org>2008-03-21 08:23:25 +0000
commitba540b27d633327453067e692e5ccb2095d417c1 (patch)
tree85009349e539f1265173b5d33889d0fca5031c61 /sys/kern/kern_sig.c
parent8420f5505a178be36939d61d6e9da31e0f2eb05a (diff)
downloadFreeBSD-src-ba540b27d633327453067e692e5ccb2095d417c1.zip
FreeBSD-src-ba540b27d633327453067e692e5ccb2095d417c1.tar.gz
- Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs
to enter thread_suspend_check(). - Set TDF_ASTPENDING along with TDF_NEEDSUSPCHK so we can move the thread_suspend_check() to ast() rather than userret(). - Check TDF_NEEDSUSPCHK in the sleepq_catch_signals() optimization so that we don't miss a suspend request. If this is set use the expensive signal path. - Set NEEDSUSPCHK when creating a new thread in thr in case the creating thread is due to be suspended as well but has not yet. Reviewed by: davidxu (Authored original patch)
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index eee71f1..6fc597b 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2286,6 +2286,7 @@ sig_suspend_threads(struct thread *td, struct proc *p, int sending)
FOREACH_THREAD_IN_PROC(p, td2) {
thread_lock(td2);
+ td2->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK;
if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) &&
(td2->td_flags & TDF_SINTR) &&
!TD_IS_SUSPENDED(td2)) {
OpenPOWER on IntegriCloud