aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2003-06-10 02:21:32 +0000
committerDavid Xu <davidxu@FreeBSD.org>2003-06-10 02:21:32 +0000
commit36407bec4fad5e09e6d10049562c4bec21cc1505 (patch)
tree00914c8b6d0a412a7b9c5c7a92c174e43e363ceb /sys/kern/kern_kse.c
parent4aeece6a14eeb27e068e7cc19551060c68cde52d (diff)
downloadsrc-36407bec4fad5e09e6d10049562c4bec21cc1505.tar.gz
src-36407bec4fad5e09e6d10049562c4bec21cc1505.zip
If there are signals delivered to current thread, breaks out of loop,
userret() will be called again by ast() and thread_userret() will be called again by userret(). Reported by: tegge
Notes
Notes: svn path=/head/; revision=116138
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index ed37c48b1fa7..4c2f592ea42f 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -1637,8 +1637,6 @@ thread_userret(struct thread *td, struct trapframe *frame)
PROC_LOCK(p);
mtx_lock_spin(&sched_lock);
while (p->p_numthreads > max_threads_per_proc) {
- if (P_SHOULDSTOP(p))
- break;
upcalls = 0;
FOREACH_KSEGRP_IN_PROC(p, kg2) {
if (kg2->kg_numupcalls == 0)
@@ -1650,8 +1648,9 @@ thread_userret(struct thread *td, struct trapframe *frame)
break;
mtx_unlock_spin(&sched_lock);
p->p_maxthrwaits++;
- msleep(&p->p_numthreads, &p->p_mtx, PPAUSE|PCATCH,
- "maxthreads", NULL);
+ if (msleep(&p->p_numthreads, &p->p_mtx, PPAUSE|PCATCH,
+ "maxthreads", NULL))
+ break;
p->p_maxthrwaits--;
mtx_lock_spin(&sched_lock);
}