diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2008-04-19 04:45:51 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2008-04-19 04:45:51 +0000 |
commit | 244fcd138508ba4280fe2c49ea250ce3791e7bbf (patch) | |
tree | 02346ea9e89203295ec8ff31b7473eb1d9e71d68 | |
parent | ec62595290a82504346ce04fa57449110ecacdd6 (diff) |
Notes
-rw-r--r-- | sys/kern/subr_sleepqueue.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index ac53fce06989..5e99d2218480 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -403,12 +403,15 @@ sleepq_catch_signals(void *wchan) mtx_unlock(&ps->ps_mtx); } /* - * Lock sleepq chain before unlocking proc - * without this, we could lose a race. + * Lock the per-process spinlock prior to dropping the PROC_LOCK + * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and + * thread_lock() are currently held in tdsignal(). */ + PROC_SLOCK(p); mtx_lock_spin(&sc->sc_lock); PROC_UNLOCK(p); thread_lock(td); + PROC_SUNLOCK(p); if (ret == 0) { if (!(td->td_flags & TDF_INTERRUPT)) { sleepq_switch(wchan); |