Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 27 Jun 2002 16:22:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 27 Jun 2002 16:22:01 -0400 Received: from mail.webmaster.com ([216.152.64.131]:25045 "EHLO shell.webmaster.com") by vger.kernel.org with ESMTP id convert rfc822-to-8bit; Thu, 27 Jun 2002 16:21:59 -0400 From: David Schwartz To: , Hugh Dickins CC: X-Mailer: PocoMail 2.61 (1025) - Licensed Version Date: Thu, 27 Jun 2002 13:24:14 -0700 In-Reply-To: Subject: Re: [PATCH] shm_destroy lock hang Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 8BIT Message-ID: <20020627202415.AAA1385@shell.webmaster.com@whenever> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 518 Lines: 30 >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(); } DS - 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/