From owner-freebsd-threads@FreeBSD.ORG Mon Feb 4 16:31:13 2008 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45C2516A417; Mon, 4 Feb 2008 16:31:13 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id F20B613C4D5; Mon, 4 Feb 2008 16:31:12 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.2/8.14.2/NETPLEX) with ESMTP id m14GV9X1005093; Mon, 4 Feb 2008 11:31:09 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Mon, 04 Feb 2008 11:31:09 -0500 (EST) Date: Mon, 4 Feb 2008 11:31:09 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <868x20elw0.fsf@ds4.des.no> Message-ID: References: <200802032238.m13McAbf065324@repoman.freebsd.org> <86d4rdgehd.fsf@ds4.des.no> <868x20elw0.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-684387517-1202142669=:13899" 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: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 16:31:13 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-684387517-1202142669=:13899 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 4 Feb 2008, Dag-Erling Sm=C3=B8rgrav wrote: > 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... Because it is more obvious that _isowned() is for the current thread than _islocked(). As you can tell by my previous (incorrect)=20 assumption. There is prior art for this outside of FreeBSD. Solaris has mutex_owned() as part of their kernel mutex API. I would suggest using pthread_mutex_owned_np(). Hmm, even FreeBSD has mtx_owned() :-) --=20 DE ---559023410-684387517-1202142669=:13899--