sleep_signal_check() is there to look for pending signals / single thread
requests which were posted before sleep_setup() finished. Once p_stat
is set to SSLEEP the wakeup and delivery of signals is taken care of
by ptsignal and single_thread_set().
Moving the SCHED_LOCK further down allows to cleanup cursig() and to
remove a SCHED_LOCK recursion in single_thread_check().
OK mpi@
-/* $OpenBSD: kern_sig.c,v 1.312 2023/08/13 15:53:31 claudio Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.313 2023/08/16 07:55:52 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
{
struct process *pr = p->p_p;
int signum, mask, prop;
- int dolock = (p->p_flag & P_SINTR) == 0;
sigset_t ps_siglist;
int s;
single_thread_set(p, SINGLE_SUSPEND, 0);
pr->ps_xsig = signum;
- if (dolock)
- SCHED_LOCK(s);
+ SCHED_LOCK(s);
proc_stop(p, 1);
- if (dolock)
- SCHED_UNLOCK(s);
+ SCHED_UNLOCK(s);
/*
* re-take the signal before releasing
prop & SA_TTYSTOP))
break; /* == ignore */
pr->ps_xsig = signum;
- if (dolock)
- SCHED_LOCK(s);
+ SCHED_LOCK(s);
proc_stop(p, 1);
- if (dolock)
- SCHED_UNLOCK(s);
+ SCHED_UNLOCK(s);
break;
} else if (prop & SA_IGNORE) {
/*
-/* $OpenBSD: kern_synch.c,v 1.197 2023/08/14 08:33:24 mpi Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.198 2023/08/16 07:55:52 claudio Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
timeout_add(&p->p_sleep_to, timo);
}
- SCHED_LOCK(s);
if (catch != 0) {
/*
* We put ourselves on the sleep queue and start our
}
}
+ SCHED_LOCK(s);
/*
* If the wakeup happens while going to sleep, p->p_wchan
* will be NULL. In that case unwind immediately but still