Rework last exiting thread in kse_release(), wait a signal and then

schedule an upcall and call thread_exit().
This commit is contained in:
David Xu 2002-11-17 10:12:00 +00:00
parent a17eb04b82
commit db9b0729fc
2 changed files with 22 additions and 4 deletions

View File

@ -357,8 +357,17 @@ kse_release(struct thread *td, struct kse_release_args *uap)
/* NOTREACHED */
} else {
mtx_unlock_spin(&sched_lock);
PROC_UNLOCK(p);
return EWOULDBLOCK;
if (td->td_standin == NULL) {
PROC_UNLOCK(p);
td->td_standin = thread_alloc();
PROC_LOCK(p);
}
msleep(p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH,
"pause", 0);
mtx_lock_spin(&sched_lock);
td->td_flags &= ~TDF_UNBOUND;
thread_schedule_upcall(td, td->td_kse);
thread_exit();
}
}
return (EINVAL);

View File

@ -357,8 +357,17 @@ kse_release(struct thread *td, struct kse_release_args *uap)
/* NOTREACHED */
} else {
mtx_unlock_spin(&sched_lock);
PROC_UNLOCK(p);
return EWOULDBLOCK;
if (td->td_standin == NULL) {
PROC_UNLOCK(p);
td->td_standin = thread_alloc();
PROC_LOCK(p);
}
msleep(p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH,
"pause", 0);
mtx_lock_spin(&sched_lock);
td->td_flags &= ~TDF_UNBOUND;
thread_schedule_upcall(td, td->td_kse);
thread_exit();
}
}
return (EINVAL);