Indicate that a process has stopped by setting PS_STOPPED flag
authorclaudio <claudio@openbsd.org>
Tue, 15 Oct 2024 13:49:26 +0000 (13:49 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 15 Oct 2024 13:49:26 +0000 (13:49 +0000)
commitc34760375439979984b84872f6678f1f4d7cda55
treea2f2e961b13bc84980635cd3a4f24c2d8e509607
parentc9003b50c37ae389c00c2c679ef66128e37bec89
Indicate that a process has stopped by setting PS_STOPPED flag

The checks in dowait6 and orphanpg using ps_mainproc are flawed and
fail if the mainproc called pthread_exit before the other threads.
Adding the flag in proc_stop_sweep is racy but the best we have right now.
This fixes regress/sys/kern/signal/sig-stop3.

OK mpi@
sys/kern/kern_exit.c
sys/kern/kern_proc.c
sys/kern/kern_sig.c
sys/sys/proc.h