replace wakeup_one() with wakeup(). wakeup_one() can only be used if the

woken-up thread is guaranteed to pass the buck to the next guy before
going back to sleep, and the rest of the lockmgr() code doesn't do that.
from Bill Sommerfeld.  fixes PR 14097.
This commit is contained in:
chs 2001-09-29 21:27:49 +00:00
parent 523ed5e837
commit adb1a233b7

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lock.c,v 1.58 2001/09/25 06:13:29 chs Exp $ */
/* $NetBSD: kern_lock.c,v 1.59 2001/09/29 21:27:49 chs Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -257,7 +257,7 @@ do { \
do { \
if (((lkp)->lk_flags & LK_SPIN) == 0 && (lkp)->lk_waitcount) { \
/* XXX Cast away volatile. */ \
wakeup_one((void *)(lkp)); \
wakeup((void *)(lkp)); \
} \
} while (/*CONSTCOND*/0)
@ -791,7 +791,7 @@ lockmgr(__volatile struct lock *lkp, u_int flags,
(LK_HAVE_EXCL | LK_WANT_EXCL | LK_WANT_UPGRADE)) == 0 &&
lkp->lk_sharecount == 0 && lkp->lk_waitcount == 0)) {
lkp->lk_flags &= ~LK_WAITDRAIN;
wakeup_one((void *)&lkp->lk_flags);
wakeup((void *)&lkp->lk_flags);
}
/*
* Note that this panic will be a recursive panic, since