diff options
author | jeff <jeff@FreeBSD.org> | 2008-03-21 08:23:25 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-03-21 08:23:25 +0000 |
commit | ba540b27d633327453067e692e5ccb2095d417c1 (patch) | |
tree | 85009349e539f1265173b5d33889d0fca5031c61 /sys/kern/kern_thr.c | |
parent | 8420f5505a178be36939d61d6e9da31e0f2eb05a (diff) | |
download | FreeBSD-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_thr.c')
-rw-r--r-- | sys/kern/kern_thr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 3d410b5..61d9a88 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -235,6 +235,8 @@ create_thread(struct thread *td, mcontext_t *ctx, /* let the scheduler know about these things. */ sched_fork_thread(td, newtd); thread_unlock(td); + if (P_SHOULDSTOP(p)) + newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; PROC_UNLOCK(p); thread_lock(newtd); if (rtp != NULL) { |