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 /sys/kern/kern_context.c | |
| parent | 538621734a69562b17c1a09c7d0b2d971bccb20c (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_context.c')
| -rw-r--r-- | sys/kern/kern_context.c | 6 |
1 files changed, 5 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); |
