[Patch] C1X threading support

David Schultz das at FreeBSD.ORG
Sat Dec 17 03:38:47 UTC 2011


On Fri, Dec 16, 2011, Warner Losh wrote:
> 
> On Dec 16, 2011, at 3:31 PM, Kostik Belousov wrote:
> 
> > On Fri, Dec 16, 2011 at 11:19:59PM +0100, Ed Schouten wrote:
> >> Hello Kostik,
> >> 
> >> * Kostik Belousov <kostikbel at gmail.com>, 20111216 23:09:
> >>> If application that does not use the new interface supposed to be
> >>> able to implement function with new names, then the not-underscored
> >>> symbols must be weak.
> >> 
> >> For example when an application wants to implement its own functions
> >> that are named thrd_*(), for example?
> > Yes. The realistic example is the code written to C99/SUSv4 conformance
> > that happens to define thrd_<something>.
> > 
> > It might be that easiest solution is to put the functions into
> > separate library, besides defining them weak.
> 
> I thought the canonical solution here was to say
> 
> #if POSIX_VISIBLE >= 201201
> <prototypes here>
> #endif
> 
> Except this isn't posix. :(

In this case it's #if __ISO_C_VISIBLE >= x (with the appropriate
changes in <sys/cdefs.h> for the new standard).  That deals with
visibility issues in the compiler.  The weak symbols deal with
visibility issues in the linker.


More information about the freebsd-threads mailing list