Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_sig.c
Show First 20 Lines • Show All 1,541 Lines • ▼ Show 20 Lines | kern_sigsuspend(struct thread *td, sigset_t mask) | ||||
/* | /* | ||||
* Process signals now. Otherwise, we can get spurious wakeup | * Process signals now. Otherwise, we can get spurious wakeup | ||||
* due to signal entered process queue, but delivered to other | * due to signal entered process queue, but delivered to other | ||||
* thread. But sigsuspend should return only on signal | * thread. But sigsuspend should return only on signal | ||||
* delivery. | * delivery. | ||||
*/ | */ | ||||
(p->p_sysent->sv_set_syscall_retval)(td, EINTR); | (p->p_sysent->sv_set_syscall_retval)(td, EINTR); | ||||
for (has_sig = 0; !has_sig;) { | for (has_sig = 0; !has_sig;) { | ||||
while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", | while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH|PUSERW, | ||||
0) == 0) | "pause", 0) == 0) | ||||
/* void */; | /* void */; | ||||
thread_suspend_check(0); | thread_suspend_check(0); | ||||
mtx_lock(&p->p_sigacts->ps_mtx); | mtx_lock(&p->p_sigacts->ps_mtx); | ||||
while ((sig = cursig(td)) != 0) { | while ((sig = cursig(td)) != 0) { | ||||
KASSERT(sig >= 0, ("sig %d", sig)); | KASSERT(sig >= 0, ("sig %d", sig)); | ||||
has_sig += postsig(sig); | has_sig += postsig(sig); | ||||
} | } | ||||
mtx_unlock(&p->p_sigacts->ps_mtx); | mtx_unlock(&p->p_sigacts->ps_mtx); | ||||
▲ Show 20 Lines • Show All 2,691 Lines • Show Last 20 Lines |