From owner-cvs-src@FreeBSD.ORG Mon Feb 4 11:15:03 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 E95BE16A421; Mon, 4 Feb 2008 11:15:03 +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 9FB5613C4F4; Mon, 4 Feb 2008 11:15:03 +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 20B10207F; Mon, 4 Feb 2008 12:14:55 +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 9FB8F2049; Mon, 4 Feb 2008 12:14:54 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 84F24844A0; Mon, 4 Feb 2008 12:14:54 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@FreeBSD.org References: <200802032238.m13McAbf065324@repoman.freebsd.org> Date: Mon, 04 Feb 2008 12:14:54 +0100 In-Reply-To: <200802032238.m13McAbf065324@repoman.freebsd.org> (Dag-Erling Smorgrav's message of "Sun\, 3 Feb 2008 22\:38\:10 +0000 \(UTC\)") Message-ID: <86d4rdgehd.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, 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 11:15:04 -0000 Dag-Erling Smorgrav writes: > Log: > Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is > locked. This is intended primarily to support the userland equivalent > of the various *_ASSERT_LOCKED() macros we have in the kernel. 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". DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no