[RFC] Add C11 threads.h support.

Rich Felker dalias@libc.org
Sun Jun 28 11:59:00 GMT 2015


On Sat, Jun 27, 2015 at 05:04:26PM +0200, Juan Manuel Torres Palma wrote:
> > You need to call the implementation-namespace names such as
> > __pthread_once.  It's not enough that they exist if you then use the other
> > names for those functions; you must avoid any strong references (defined
> > or undefined) to names outside the C11 and implementation namespaces (and
> > any uses of weak undefined symbols outside those namespaces that might get
> > executed for conforming code).
> 
> I don't get this point either. I thought this code will be executing
> inside the library, where __pthread_* symbols are exactly the same
> than pthread_* symbols. So, if the user redefines pthread_* symbols
> (He's a llowed to do that), won't affect symbols inside library. Am I
> wrong?

Yes, you're wrong about this. pthread_* are not reserved in a plain C
program that does not use POSIX; an application can define them (or
any other POSIX symbols that aren't in plain C) for any purpose it
wants.

There is no such thing as "inside the library" except possibly as a
linking optimization for shared libraries. With an archive (static)
library, object files from the library have no special status distinct
from object files provided by the program or third-party libraries.

Rich



More information about the Libc-alpha mailing list