Alexander Pyhalov ha scritto:
> Can someone explain why this stubs are in libc? Why didn't linker just
> throw a linking error?

Simple explanation: the stubs are there because you can create a
thread-safe library and use it in a single-threaded or multi-threaded
program. Once linked to a multi-threaded program (with -pthread) the
library gets access to the real libthr implementations of the pthread_*
functions, while in the single-threaded program the library will use the
libc stubs without affecting performance.
If you encounter errors probably your program/libraries dynamically
loads shared libraries that link with libthr and so you eventually call
some pthread_* functions from libc and others from libthr.

-- 
Alex Dupre
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[email protected]"

Reply via email to