Assert on pg_jobc state.

Stolen from NetBSD.
This commit is contained in:
Mateusz Guzik 2020-06-09 15:17:23 +00:00
parent 7ce3a31286
commit 90a08d6cad
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361967

View File

@ -751,9 +751,11 @@ pgadjustjobc(struct pgrp *pgrp, int entering)
{
PGRP_LOCK(pgrp);
if (entering)
if (entering) {
MPASS(pgrp->pg_jobc >= 0);
pgrp->pg_jobc++;
else {
} else {
MPASS(pgrp->pg_jobc > 0);
--pgrp->pg_jobc;
if (pgrp->pg_jobc == 0)
orphanpg(pgrp);