Download raw body.
refcnt: Improve assertion on take
Hi, This is a resend of https://marc.info/?l=openbsd-tech&m=174043502604444 from earlier this year. atomic_inc_int_nv() returns the incremented value. And you can only take a reference if you hold one already. It passes regress. But more testers are welcome. - Christian --- sys/kern/kern_synch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 144283d005ac..08e7d165d1bd 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -919,7 +919,7 @@ refcnt_take(struct refcnt *r) u_int refs; refs = atomic_inc_int_nv(&r->r_refs); - KASSERT(refs != 0); + KASSERT(refs > 1); TRACEINDEX(refcnt, r->r_traceidx, r, refs - 1, +1); (void)refs; }
refcnt: Improve assertion on take