From 9a8a455a6a40bd0f5b70e3d3a8bdbf6f4eaaebf5 Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 6 Jun 2003 02:17:38 +0000 Subject: thread_signal_add now is called with ps_mtx held, unlock it before calling copyin. --- sys/kern/kern_kse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/kern/kern_kse.c') diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 0dcadeb..ed37c48 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -1397,11 +1397,12 @@ thread_signal_add(struct thread *td, int sig) sigset_t ss; int error; - PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_assert(&p->p_sigacts->ps_mtx, MA_OWNED); td = curthread; ku = td->td_upcall; - p = td->td_proc; - + mtx_unlock(&p->p_sigacts->ps_mtx); PROC_UNLOCK(p); error = copyin(&ku->ku_mailbox->km_sigscaught, &ss, sizeof(sigset_t)); if (error) @@ -1414,6 +1415,7 @@ thread_signal_add(struct thread *td, int sig) goto error; PROC_LOCK(p); + mtx_lock(&p->p_sigacts->ps_mtx); return; error: PROC_LOCK(p); -- cgit v1.1