-/* $OpenBSD: kern_exit.c,v 1.195 2021/02/08 10:51:01 mpi Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.196 2021/02/15 09:35:59 mpi Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
{
struct process *pr, *qr, *nqr;
struct rusage *rup;
+ int s;
atomic_setbits_int(&p->p_flag, P_WEXIT);
}
/* unlink ourselves from the active threads */
+ SCHED_LOCK(s);
TAILQ_REMOVE(&pr->ps_threads, p, p_thr_link);
+ SCHED_UNLOCK(s);
if ((p->p_flag & P_THREAD) == 0) {
/* main thread gotta wait because it has the pid, et al */
while (pr->ps_refcnt > 1)
-/* $OpenBSD: kern_fork.c,v 1.233 2021/02/11 13:40:28 otto Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.234 2021/02/15 09:35:59 mpi Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
LIST_INSERT_HEAD(&allproc, p, p_list);
LIST_INSERT_HEAD(TIDHASH(p->p_tid), p, p_hash);
- TAILQ_INSERT_TAIL(&pr->ps_threads, p, p_thr_link);
+ SCHED_LOCK(s);
+ TAILQ_INSERT_TAIL(&pr->ps_threads, p, p_thr_link);
/*
* if somebody else wants to take us to single threaded mode,
* count ourselves in.
*/
- SCHED_LOCK(s);
if (pr->ps_single) {
atomic_inc_int(&pr->ps_singlecount);
atomic_setbits_int(&p->p_flag, P_SUSPSINGLE);
-/* $OpenBSD: kern_sig.c,v 1.272 2021/02/08 10:51:01 mpi Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.273 2021/02/15 09:35:59 mpi Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
signum != SIGKILL) {
pr->ps_xsig = signum;
- if (dolock)
- KERNEL_LOCK();
single_thread_set(p, SINGLE_PTRACE, 0);
- if (dolock)
- KERNEL_UNLOCK();
if (dolock)
SCHED_LOCK(s);
struct proc *q;
int error, s;
- KERNEL_ASSERT_LOCKED();
KASSERT(curproc == p);
SCHED_LOCK(s);
-/* $OpenBSD: proc.h,v 1.308 2021/02/08 10:51:02 mpi Exp $ */
+/* $OpenBSD: proc.h,v 1.309 2021/02/15 09:35:59 mpi Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
struct ucred *ps_ucred; /* Process owner's identity. */
LIST_ENTRY(process) ps_list; /* List of all processes. */
- TAILQ_HEAD(,proc) ps_threads; /* Threads in this process. */
+ TAILQ_HEAD(,proc) ps_threads; /* [K|S] Threads in this process. */
LIST_ENTRY(process) ps_pglist; /* List of processes in pgrp. */
struct process *ps_pptr; /* Pointer to parent process. */