From owner-cvs-src@FreeBSD.ORG Tue Oct 14 12:05:49 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D91316A4B3; Tue, 14 Oct 2003 12:05:49 -0700 (PDT) Received: from mail.chesapeake.net (chesapeake.net [208.142.252.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id D00A443F75; Tue, 14 Oct 2003 12:05:47 -0700 (PDT) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id h9EJ5lT95242; Tue, 14 Oct 2003 15:05:47 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Tue, 14 Oct 2003 15:05:47 -0400 (EDT) From: Jeff Roberson To: John Baldwin In-Reply-To: Message-ID: <20031014150419.Y56213-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: Jeff Roberson cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: RE: cvs commit: src/sys/sys mutex.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2003 19:05:49 -0000 On Tue, 14 Oct 2003, John Baldwin wrote: > > On 12-Oct-2003 Jeff Roberson wrote: > > jeff 2003/10/12 14:02:55 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/sys mutex.h > > Log: > > - Implement a mtx_ownedby() macro which can be used to determine if a > > particular thread owns a mutex. This cannot be done without races > > unless the thread is curthread. > > This is a very bad idea. What use do you have for this that is not > already handled by mtx_owned() or a mutex assertion? I know it is racy in most contexts. I use it to check to see if a thread on the runq owns giant. Since I have the sched lock it isn't racy but even if it was it wouldn't matter in this case. Cheers, Jeff > > -- > > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ >