diff options
author | davidxu <davidxu@FreeBSD.org> | 2002-10-26 02:56:51 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2002-10-26 02:56:51 +0000 |
commit | 9f183ef3fc4b399e4f2f692fae59561ff880bda8 (patch) | |
tree | 6492c9f839f3ded109f3c129f9bfa4997a515faa | |
parent | d6616ee5d80ae5b0864582b12c622b7768b5c2ee (diff) | |
download | FreeBSD-src-9f183ef3fc4b399e4f2f692fae59561ff880bda8.zip FreeBSD-src-9f183ef3fc4b399e4f2f692fae59561ff880bda8.tar.gz |
Move suspension checking code from userret() into thread_userret().
-rw-r--r-- | sys/kern/kern_kse.c | 12 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 12 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 15 |
3 files changed, 26 insertions, 13 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 2b4ad4a..7721788 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -1241,6 +1241,18 @@ thread_userret(struct thread *td, struct trapframe *frame) p = td->td_proc; /* + * We need to check to see if we have to exit or wait due to a + * single threading requirement or some other STOP condition. + * Don't bother doing all the work if the stop bits are not set + * at this time.. If we miss it, we miss it.. no big deal. + */ + if (P_SHOULDSTOP(p)) { + PROC_LOCK(p); + thread_suspend_check(0); /* Can suspend or kill */ + PROC_UNLOCK(p); + } + + /* * Originally bound threads never upcall but they may * loan out their KSE at this point. * Upcalls imply bound.. They also may want to do some Philantropy. diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 2b4ad4a..7721788 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1241,6 +1241,18 @@ thread_userret(struct thread *td, struct trapframe *frame) p = td->td_proc; /* + * We need to check to see if we have to exit or wait due to a + * single threading requirement or some other STOP condition. + * Don't bother doing all the work if the stop bits are not set + * at this time.. If we miss it, we miss it.. no big deal. + */ + if (P_SHOULDSTOP(p)) { + PROC_LOCK(p); + thread_suspend_check(0); /* Can suspend or kill */ + PROC_UNLOCK(p); + } + + /* * Originally bound threads never upcall but they may * loan out their KSE at this point. * Upcalls imply bound.. They also may want to do some Philantropy. diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 9f8bed0..2337423 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -100,19 +100,8 @@ userret(td, frame, oticks) sched_userret(td); /* - * We need to check to see if we have to exit or wait due to a - * single threading requirement or some other STOP condition. - * Don't bother doing all the work if the stop bits are not set - * at this time.. If we miss it, we miss it.. no big deal. - */ - if (P_SHOULDSTOP(p)) { - PROC_LOCK(p); - thread_suspend_check(0); /* Can suspend or kill */ - PROC_UNLOCK(p); - } - - /* - * Do special thread processing, e.g. upcall tweaking and such. + * Do special thread processing, e.g. suspension checking, upcall + * tweaking and such. */ if (p->p_flag & P_KSES) { thread_userret(td, frame); |