diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2003-04-17 22:21:57 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2003-04-17 22:21:57 +0000 |
| commit | 94df4b85844c22f103769e1e6434ddedfbca5805 (patch) | |
| tree | fe1491e67e9166459fe18c741883a612388b5b4b | |
| parent | 538621734a69562b17c1a09c7d0b2d971bccb20c (diff) | |
Notes
| -rw-r--r-- | sys/kern/kern_context.c | 6 | ||||
| -rw-r--r-- | sys/kern/kern_kse.c | 2 | ||||
| -rw-r--r-- | sys/kern/kern_thr.c | 2 | ||||
| -rw-r--r-- | sys/kern/kern_thread.c | 2 |
4 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/kern_context.c b/sys/kern/kern_context.c index ffb3f95a93c1..653475d2df21 100644 --- a/sys/kern/kern_context.c +++ b/sys/kern/kern_context.c @@ -66,13 +66,15 @@ int getcontext(struct thread *td, struct getcontext_args *uap) { ucontext_t uc; - int ret; + int ret; if (uap->ucp == NULL) ret = EINVAL; else { get_mcontext(td, &uc.uc_mcontext); + PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); ret = copyout(&uc, uap->ucp, UC_COPY_SIZE); } return (ret); @@ -114,7 +116,9 @@ swapcontext(struct thread *td, struct swapcontext_args *uap) ret = EINVAL; else { get_mcontext(td, &uc.uc_mcontext); + PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); ret = copyout(&uc, uap->oucp, UC_COPY_SIZE); if (ret == 0) { ret = copyin(uap->ucp, &uc, UC_COPY_SIZE); diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index bfc97ad597fe..784d45b0a77b 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -747,7 +747,9 @@ thread_getcontext(struct thread *td, ucontext_t *uc) #ifdef __i386__ get_mcontext(td, &uc->uc_mcontext); #endif + PROC_LOCK(td->td_proc); uc->uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); } /* diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index c2a2103578c0..488cf6f320d7 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -153,7 +153,9 @@ thr_create(struct thread *td, struct thr_create_args *uap) (unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy)); td0->td_proc = td->td_proc; + PROC_LOCK(td->td_proc); td0->td_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); bcopy(td->td_frame, td0->td_frame, sizeof(struct trapframe)); td0->td_ucred = crhold(td->td_ucred); diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index bfc97ad597fe..784d45b0a77b 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -747,7 +747,9 @@ thread_getcontext(struct thread *td, ucontext_t *uc) #ifdef __i386__ get_mcontext(td, &uc->uc_mcontext); #endif + PROC_LOCK(td->td_proc); uc->uc_sigmask = td->td_sigmask; + PROC_UNLOCK(td->td_proc); } /* |
