Date: Fri, 20 Aug 2004 09:06:53 -0700 (PDT) From: John Polstra <jdp@polstra.com> To: (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) <des@des.no> Cc: Pawel Jakub Dawidek <pjd@freebsd.org> Subject: Re: Bogus usage of tsleep(9) in USB. Message-ID: <XFMail.20040820090653.jdp@polstra.com> In-Reply-To: <xzpisbdgbpy.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On 20-Aug-2004 Dag-Erling Smørgrav wrote:
> Pawel Jakub Dawidek <pjd@FreeBSD.org> writes:
>> There are many calls to tsleep(9) with no timeout in our USB code.
>> As you all know, it is not permitted and we have KASSERT() for this:
>>
>> KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL,
>> ("sleeping without a mutex"));
>
> This panic message only applies to one of the three conditions the
> KASSERT tests. It should probably be split into three separate
> KASSERTs with three different panic messages.
How would you do that? Those are "||" operators, not "&&". There
is only one way to fail: by violating all three subconditions.
John
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20040820090653.jdp>
