unlock sched_lock at right time.

This commit is contained in:
David Xu 2003-04-27 04:32:40 +00:00
parent 5adbdf5429
commit 5073e68fa3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114106
2 changed files with 2 additions and 2 deletions

View File

@ -1681,9 +1681,9 @@ thread_userret(struct thread *td, struct trapframe *frame)
else
upcalls += kg2->kg_numupcalls;
}
mtx_unlock_spin(&sched_lock);
if (upcalls >= max_threads_per_proc)
break;
mtx_unlock_spin(&sched_lock);
p->p_maxthrwaits++;
msleep(&p->p_numthreads, &p->p_mtx, PPAUSE|PCATCH,
"maxthreads", NULL);

View File

@ -1681,9 +1681,9 @@ thread_userret(struct thread *td, struct trapframe *frame)
else
upcalls += kg2->kg_numupcalls;
}
mtx_unlock_spin(&sched_lock);
if (upcalls >= max_threads_per_proc)
break;
mtx_unlock_spin(&sched_lock);
p->p_maxthrwaits++;
msleep(&p->p_numthreads, &p->p_mtx, PPAUSE|PCATCH,
"maxthreads", NULL);