[Bug 192320] Use of thread_local produces linking errors on system version of clang++

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Feb 18 21:30:35 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192320

--- Comment #4 from David Chisnall <theraven at FreeBSD.org> ---
I'm still not completely sure what the correct solution for implementing this
is.  

Clang will always lazily construct thread_local objects on first access (which
means that you can't use them to track thread counts and so on, which limits
their use somewhat), but the destructors will run when the thread exits.

Unfortunately, the destructors might not be signal safe and so there is no
*good* way of running them on library unload.  A complete solution most likely
involves locking the library in memory while it has outstanding thread-local
objects.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-toolchain mailing list