Re: lock_kernel check...

Zwane Mwaikambo (zwane@linuxpower.ca)
Tue, 9 Jul 2002 12:31:30 +0200 (SAST)


On Tue, 9 Jul 2002, Dave Hansen wrote:

> It isn't absoulutely a bad thing to return while you have a lock held.
> It might be hard to understand, or even crazy, but not immediately
> wrong :)
>
> // BKL protects both "a", and io port 0xF00D
> bar()
> {
> lock_kernel();
> return inb(0xF00D);
> }
>
> int a;
> foo()
> {
> a = bar();
> a--;
> unlock_kernel();
> }

But broken nonetheless, that kinda thing just looks ugly. Especially when
someone tries to call bar multiple times or consecutively or with the lock
already held or...

Zwane Mwaikambo

-- 
function.linuxpower.ca

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/