From owner-cvs-src@FreeBSD.ORG Mon Feb 4 15:49:18 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 E5ED816A46B; Mon, 4 Feb 2008 15:49:18 +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 984FE13C4D9; Mon, 4 Feb 2008 15:49:18 +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 m14FnFlY006631; Mon, 4 Feb 2008 10:49:15 -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 10:49:15 -0500 (EST) Date: Mon, 4 Feb 2008 10:49:15 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <868x21gdtm.fsf@ds4.des.no> Message-ID: References: <200802032238.m13McAbf065324@repoman.freebsd.org> <86d4rdgehd.fsf@ds4.des.no> <3bbf2fe10802040318q456556e4g8c63299ab67c71e8@mail.gmail.com> <868x21gdtm.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-758783491-1202140155=:13743" Cc: Attilio Rao , 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 Reply-To: Daniel Eischen 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 15:49:19 -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-758783491-1202140155=:13743 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: > "Attilio Rao" writes: >> Dag-Erling Sm=C3=B8rgrav writes: >>> I'm having second thoughts about this one. There is a significant >>> risk of false positives if the mutex is currently locked by another >>> thread. I'm wondering whether to a) change the implementation so it >>> only returns true if the mutex is owned by the current thread, or b) >>> change the interface so you can specify a specific thread, or NULL >>> for "any". >> Please don't do the latter. Semantically the right thing to do here >> is to assert if the curthread owns the lock or not. Any lock should >> not be interested on what is the state in regard of other locks. > > Thank you. That was my thought as well, but I didn't want to exclude > the alternative without discussion. Then please change the API so that it is pthread_mutex_isowned_np(). --=20 DE ---559023410-758783491-1202140155=:13743--