From owner-freebsd-threads@FreeBSD.ORG Thu Feb 7 20:19:09 2008 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 446A916A420 for ; Thu, 7 Feb 2008 20:19:09 +0000 (UTC) (envelope-from ad@hairylemon.org) Received: from ns0.hairylemon.org (ns0.hairylemon.org [82.138.249.57]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC0813C478 for ; Thu, 7 Feb 2008 20:19:08 +0000 (UTC) (envelope-from ad@hairylemon.org) Received: from ad by ns0.hairylemon.org with local (Exim 4.54) id 1JNClb-0003Om-FG for freebsd-threads@freebsd.org; Thu, 07 Feb 2008 19:50:39 +0000 Date: Thu, 7 Feb 2008 19:50:39 +0000 From: Andrew Doran To: freebsd-threads@freebsd.org Message-ID: <20080207195039.GF21558@hairylemon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: Andrew Doran 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 List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 20:19:09 -0000 > 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. For what it's worth, NetBSD has the below. I found the names in FreeBSD perforce using Google and used them in the hope of being compatible. :-) I didn't find equivalents in other systems when I looked. int pthread_mutex_held_np(pthread_mutex_t *); int pthread_rwlock_held_np(pthread_rwlock_t *); int pthread_rwlock_wrheld_np(pthread_rwlock_t *); int pthread_rwlock_rdheld_np(pthread_rwlock_t *); Andrew