From owner-cvs-src@FreeBSD.ORG Mon Feb 4 16:17:59 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9742416A417; Mon, 4 Feb 2008 16:17:59 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4C92C13C45A; Mon, 4 Feb 2008 16:17:59 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 912DF207F; Mon, 4 Feb 2008 17:17:51 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.2/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 7DABD207E; Mon, 4 Feb 2008 17:17:51 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 6149584493; Mon, 4 Feb 2008 17:17:51 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Daniel Eischen References: <200802032238.m13McAbf065324@repoman.freebsd.org> <86d4rdgehd.fsf@ds4.des.no> Date: Mon, 04 Feb 2008 17:17:51 +0100 In-Reply-To: (Daniel Eischen's message of "Mon\, 4 Feb 2008 10\:47\:57 -0500 \(EST\)") Message-ID: <868x20elw0.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, threads@freebsd.org Subject: Re: cvs commit: src/include pthread_np.h src/lib/libthr pthread.map src/lib/libthr/thread thr_mutex.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 04 Feb 2008 16:17:59 -0000 Daniel Eischen writes: > I thought you wanted to know if it was locked regardless of who locked > it. Uh, no, that was not the intention. > If you want to know if the current thread has it locked, it should be > called pthread_mutex_isowned_np(). I don't see why one would be more correct than the other... > I don't really see the utility in any other behavior, and almost > question the need for _isowned. It is extremely useful when debugging threaded code, as evidenced by the numerous *_LOCKED macros that are used throughout the kernel. Those macros saved me a lot of time and aggravation when I made procfs and linprocfs MPSAFE, for instance, and I am working on userland code at the moment which would benefit greatly from the ability to assert that the appropriate mutex is locked at the entry of a function that accesses or modifies the corresponding data structure. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no