From owner-freebsd-current Mon Nov 5 14:30:27 2001 Delivered-To: freebsd-current@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 292A337B405; Mon, 5 Nov 2001 14:30:26 -0800 (PST) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id fA5MQmN77811; Mon, 5 Nov 2001 14:26:48 -0800 (PST) (envelope-from rizzo) Date: Mon, 5 Nov 2001 14:26:48 -0800 From: Luigi Rizzo To: current@freebsd.org Subject: when to use XX_LOCK() ? Message-ID: <20011105142648.E76687@iguana.aciri.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In if_dc.c and other places, i see sequences like this: dc_intr(arg) { struct dc_softc sc; sc = arg; DC_LOCK(sc); ifp = &sc->arpcom.ac_if; ... Wondering: any reason to call DC_LOCK before assigning a value to ifp ? Nobody is going to change it without taking away the device (which contains the lock itself). cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message