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/subr_sleepqueue.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/subr_sleepqueue.c')
-rw-r--r-- | sys/kern/subr_sleepqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index e12ef6e..bc3f1d8 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -391,7 +391,7 @@ sleepq_catch_signals(void *wchan, int pri) * directly. */ thread_lock(td); - if ((td->td_flags & TDF_NEEDSIGCHK) == 0) { + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) { sleepq_switch(wchan, pri); return (0); } |