From owner-freebsd-questions@FreeBSD.ORG Wed May 9 15:27:25 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F8171065674 for ; Wed, 9 May 2012 15:27:25 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from av-tac-rtp.cisco.com (av-tac-rtp.cisco.com [64.102.19.209]) by mx1.freebsd.org (Postfix) with ESMTP id 0115D8FC1F for ; Wed, 9 May 2012 15:27:24 +0000 (UTC) X-TACSUNS: Virus Scanned Received: from rooster.cisco.com (localhost.cisco.com [127.0.0.1]) by av-tac-rtp.cisco.com (8.13.8+Sun/8.13.8) with ESMTP id q49FLp6c025437 for ; Wed, 9 May 2012 11:21:51 -0400 (EDT) Received: from dhcp-64-102-211-16.cisco.com (dhcp-64-102-211-16.cisco.com [64.102.211.16]) by rooster.cisco.com (8.13.8+Sun/8.13.8) with ESMTP id q49FLo3p016340 for ; Wed, 9 May 2012 11:21:50 -0400 (EDT) Message-ID: <4FAA8B8E.2070506@marcuscom.com> Date: Wed, 09 May 2012 11:21:50 -0400 From: Joe Marcus Clarke User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: FreeBSD Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Questions on adaptive mutexes and trylock X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2012 15:27:25 -0000 The newest GLib (as well as PHP APC) is starting to use adaptive mutexes in their code. When a mutex type is set to adaptive and you try to call pthread_mutex_trylock() on it, you get back an EINVAL. Is this a bug, or should this really be happening (the code clearly indicates adaptive mutexes are not handled by trylock)? I imagine Linux is not doing this since the code doesn't abort on Linux as it does on FreeBSD. Should we be silently allowing trylock to perform a no-op on adaptive mutexes, or should we be handling adaptive mutexes with trylock? Thanks. Joe -- PGP Key : http://www.marcuscom.com/pgp.asc