Protect p_wchan with sched_lock in selwakeup().

This commit is contained in:
Jonathan Lemon 2000-11-21 20:22:34 +00:00
parent 39413503a4
commit 4a476efa51

View File

@ -1025,6 +1025,7 @@ selwakeup(sip)
sip->si_pid = 0;
if (p != NULL) {
s = splhigh();
mtx_enter(&sched_lock, MTX_SPIN);
if (p->p_wchan == (caddr_t)&selwait) {
if (p->p_stat == SSLEEP)
setrunnable(p);
@ -1032,6 +1033,7 @@ selwakeup(sip)
unsleep(p);
} else if (p->p_flag & P_SELECT)
p->p_flag &= ~P_SELECT;
mtx_exit(&sched_lock, MTX_SPIN);
splx(s);
}
}