Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Nov 2011 11:00:30 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        David Chisnall <theraven@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r227999 - head/lib/libc/gen
Message-ID:  <201111281100.30432.jhb@freebsd.org>
In-Reply-To: <201111261557.pAQFv9s1097893@svn.freebsd.org>
References:  <201111261557.pAQFv9s1097893@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, November 26, 2011 10:57:09 am David Chisnall wrote:
> Author: theraven
> Date: Sat Nov 26 15:57:09 2011
> New Revision: 227999
> URL: http://svn.freebsd.org/changeset/base/227999
> 
> Log:
>   Return not-implemented from pthread_once and pthread_key_create, rather
>   than silently failing and returning success.
>   
>   Without this, code calls pthread_once(), receives a return value of
>   success, and thinks that the passed function has been called.
>   
>   Approved by:	dim (mentor)

Hmmm, is this really the best fix?

I really want pthread_once() to always work (see the hack I have to do with 
_once() in libc to workaround the fact that it doesn't now).  The current 
behavior exists to appease libstdc++ which uses a silently failing 
pthread_once() to figure out if it is linked against working threads.

If this is for libc++, can you provide some other way than abusing 
pthread_once() to determine this?  Ideally it would be as smart as libc and 
use __isthreaded in some fastion.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111281100.30432.jhb>