diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2008-03-13 00:46:12 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2008-03-13 00:46:12 +0000 |
| commit | f4d77e9e5437081d7c9cc56e46c28ea809bb835d (patch) | |
| tree | 0bcc20e937e1f083e5f6af522fdf892ab2da969b /sys | |
| parent | cffe6e824bdcd549f0a7ca7cde170e85dd6587f3 (diff) | |
Notes
Diffstat (limited to 'sys')
| -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 175cc6030bf9..86be815a2bdd 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -403,12 +403,15 @@ sleepq_catch_signals(void *wchan, int pri) 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) { sleepq_switch(wchan, pri); return (0); |
