Re: [PATCH] shm_destroy lock hang

From: Marcelo Tosatti (marcelo@conectiva.com.br)
Date: Thu Jun 27 2002 - 15:11:45 EST


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/



This archive was generated by hypermail 2b29 : Sun Jun 30 2002 - 22:00:12 EST