Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 27 Jun 2002 17:04:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 27 Jun 2002 17:04:33 -0400 Received: from perninha.conectiva.com.br ([200.250.58.156]:3078 "HELO perninha.conectiva.com.br") by vger.kernel.org with SMTP id ; Thu, 27 Jun 2002 17:04:32 -0400 Date: Thu, 27 Jun 2002 17:11:45 -0300 (BRT) From: Marcelo Tosatti X-X-Sender: marcelo@freak.distro.conectiva To: David Schwartz Cc: Hugh Dickins , Subject: Re: [PATCH] shm_destroy lock hang In-Reply-To: <20020627202415.AAA1385@shell.webmaster.com@whenever> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 637 Lines: 34 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/