History log of /netbsd-current/tests/libexec/ld.elf_so/h_thread_local_dtor.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.2 21-Jul-2017 joerg

Avoid a race condition between dlclose and thread termination.


Revision tags: perseant-stdc-iso10646-base
# 1.1 11-Jul-2017 joerg

Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.