-/* $OpenBSD: kern_synch.c,v 1.179 2021/09/09 18:41:39 mpi Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.180 2021/10/07 08:51:00 mpi Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
for (p = TAILQ_FIRST(qp); p != NULL && n != 0; p = pnext) {
pnext = TAILQ_NEXT(p, p_runq);
/*
- * If the rwlock passed to rwsleep() is contended, the
- * CPU will end up calling wakeup() between sleep_setup()
- * and sleep_finish().
+ * This happens if wakeup(9) is called after enqueuing
+ * itself on the sleep queue and both `ident' collide.
*/
- if (p == curproc) {
- KASSERT(p->p_stat == SONPROC);
+ if (p == curproc)
continue;
- }
#ifdef DIAGNOSTIC
if (p->p_stat != SSLEEP && p->p_stat != SSTOP)
panic("wakeup: p_stat is %d", (int)p->p_stat);