From owner-freebsd-threads@FreeBSD.ORG Sun Mar 13 20:16:14 2011 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 3E09B1065673; Sun, 13 Mar 2011 20:16:14 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id EA02C8FC0C; Sun, 13 Mar 2011 20:16:13 +0000 (UTC) Received: from [10.0.0.19] (ip-414b102e.ct.fixed.ntplx.com [65.75.16.46]) (authenticated bits=0) by mail.netplex.net (8.14.4/8.14.4/NETPLEX) with ESMTP id p2DK0H62016336 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 13 Mar 2011 16:00:18 -0400 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.netplex.net [204.213.176.10]); Sun, 13 Mar 2011 16:00:18 -0400 (EDT) References: In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8F190) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (8F190) From: Daniel Eischen Date: Sun, 13 Mar 2011 16:00:17 -0400 To: Robert Watson Cc: "threads@freebsd.org" Subject: Re: pthread_key_create and !-lpthreads binaries 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: Sun, 13 Mar 2011 20:16:14 -0000 Sent from my iPhone On Mar 13, 2011, at 3:33 PM, Robert Watson wrote: >=20 > Dear threading folk: >=20 > This afternoon I wrote some threaded code for Mac OS X, and then checked i= t out on FreeBSD and was a bit surprised when it compiled but didn't work. T= urns out, of course, that on Mac OS X I'd omitted -lpthread and not noticed,= as the thread primitives are in libSystem. It ran, and the reason I ran in= to trouble is that, although no-op locking calls are fine, getting back "suc= cess" from pthread_key_create() when it has actually failed is problematic. >=20 > Would it be possible to make the thread stub for pthread_key_create() retu= rn an error, instead of succeeding (but not actually succeeding)? Or, perha= ps better yet, I should get a link-time error for that function, even though= I shouldn't get one for lock/unlock? >=20 > Thanks, >=20 > Robert N M Watson > Computer Laboratory > University of Cambridge > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"= >=20