Re: Bogus usage of tsleep(9) in USB.

From: John Polstra <jdp_at_polstra.com>
Date: Fri, 20 Aug 2004 09:06:53 -0700 (PDT)
On 20-Aug-2004 Dag-Erling Smørgrav wrote:
> Pawel Jakub Dawidek <pjd_at_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
Received on Fri Aug 20 2004 - 14:06:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:07 UTC