Re: [PATCH] shm_destroy lock hang

Marcelo Tosatti (marcelo@conectiva.com.br)
Thu, 27 Jun 2002 17:11:45 -0300 (BRT)


On Thu, 27 Jun 2002, David Schwartz wrote:

>
> >Just please avoid doing that locking nastyness:
> >
> >function() {
> >unlock();
> >}
> >
> >
> >lock();
> >if (something)
> > function();
> >else
> > unlock();
>
> What do you do in cases where 'function' looks like this:
>
> function() {
> something();
> unlock();
> something_else();
> }
>

Move something() outside function().

-
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/