From owner-cvs-all@FreeBSD.ORG Fri Apr 25 09:43:25 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5E9C37B404; Fri, 25 Apr 2003 09:43:25 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97A6B43FCB; Fri, 25 Apr 2003 09:43:24 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 424A55308; Fri, 25 Apr 2003 18:43:21 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: John Baldwin From: Dag-Erling Smorgrav Date: Fri, 25 Apr 2003 18:43:21 +0200 In-Reply-To: (John Baldwin's message of "Fri, 25 Apr 2003 12:07:56 -0400 (EDT)") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: Sam Leffler cc: src-committers@FreeBSD.org cc: Nate Lawson cc: cvs-all@FreeBSD.org cc: cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 16:43:26 -0000 John Baldwin writes: > Agreed, locks should be protecting data structures, not code blocks. Locks that protect code paths are called monitors and aren't very useful except in OO languages. I can't think of any cases in the kernel where we would want to lock a code path; if anyone can think of an example, I'm willing to bet that they're just deluding themselves into thinking that a lock on a singleton object (or unique variable) is actually a lock on the code that accesses it. DES -- Dag-Erling Smorgrav - des@ofug.org