summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-12-07 16:55:30 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-12-07 16:55:30 +0000
commite585edc9810873966fa95c76281eba9e51b785b0 (patch)
tree99081d25555aa187f5153149ae43d978cf6b2235 /sys/kern/kern_exit.c
parent9dd41eb298087fdc4db52b2eff5584a51db6a0c0 (diff)
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/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index a20775419e3..92bbfe915b5 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.191 2020/11/16 18:37:06 jsing Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.192 2020/12/07 16:55:28 mpi Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -63,6 +63,7 @@
#ifdef SYSVSEM
#include <sys/sem.h>
#endif
+#include <sys/smr.h>
#include <sys/witness.h>
#include <sys/mount.h>
@@ -161,7 +162,7 @@ exit1(struct proc *p, int xexit, int xsig, int flags)
}
/* unlink ourselves from the active threads */
- TAILQ_REMOVE(&pr->ps_threads, p, p_thr_link);
+ SMR_TAILQ_REMOVE_LOCKED(&pr->ps_threads, p, p_thr_link);
if ((p->p_flag & P_THREAD) == 0) {
/* main thread gotta wait because it has the pid, et al */
while (pr->ps_refcnt > 1)
@@ -724,7 +725,7 @@ process_zap(struct process *pr)
if (pr->ps_ptstat != NULL)
free(pr->ps_ptstat, M_SUBPROC, sizeof(*pr->ps_ptstat));
pool_put(&rusage_pool, pr->ps_ru);
- KASSERT(TAILQ_EMPTY(&pr->ps_threads));
+ KASSERT(SMR_TAILQ_EMPTY_LOCKED(&pr->ps_threads));
lim_free(pr->ps_limit);
crfree(pr->ps_ucred);
pool_put(&process_pool, pr);