summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2020-12-07 16:55:28 +0000
committermpi <mpi@openbsd.org>2020-12-07 16:55:28 +0000
commitb21c774f9611a2013048bb9dfc02468e6860dad1 (patch)
tree0edc08a4801a5acf3d04ac257d6e94fc91e554f5 /sys/kern/sys_process.c
parentLimit the URL embedded in .cer files to only consist out of isalnum or (diff)
downloadwireguard-openbsd-b21c774f9611a2013048bb9dfc02468e6860dad1.tar.xz
wireguard-openbsd-b21c774f9611a2013048bb9dfc02468e6860dad1.zip
Convert the per-process thread list into a SMR_TAILQ.
Currently all iterations are done under KERNEL_LOCK() and therefor use the *_LOCKED() variant. From and ok claudio@
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 4f6bc30cd76..3af92ae8084 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.84 2020/10/19 08:19:46 mpi Exp $ */
+/* $OpenBSD: sys_process.c,v 1.85 2020/12/07 16:55:29 mpi Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -301,7 +301,7 @@ ptrace_ctrl(struct proc *p, int req, pid_t pid, caddr_t addr, int data)
error = ESRCH;
goto fail;
}
- t = TAILQ_FIRST(&tr->ps_threads);
+ t = SMR_TAILQ_FIRST_LOCKED(&tr->ps_threads);
break;
/* calls that accept a PID or a thread ID */
@@ -561,9 +561,9 @@ ptrace_kstate(struct proc *p, int req, pid_t pid, void *addr)
return ESRCH;
if (t->p_p != tr)
return EINVAL;
- t = TAILQ_NEXT(t, p_thr_link);
+ t = SMR_TAILQ_NEXT_LOCKED(t, p_thr_link);
} else {
- t = TAILQ_FIRST(&tr->ps_threads);
+ t = SMR_TAILQ_FIRST_LOCKED(&tr->ps_threads);
}
if (t == NULL)
@@ -754,7 +754,7 @@ process_tprfind(pid_t tpid, struct proc **tp)
if (tr == NULL)
return NULL;
- *tp = TAILQ_FIRST(&tr->ps_threads);
+ *tp = SMR_TAILQ_FIRST_LOCKED(&tr->ps_threads);
return tr;
}
}