bcea0e2afd
We want to delay the emutls pthread key deletion to keep __thread/thread_local variables working as long as possible. Currently, emutls has its own __attribute__((destructor)) function that deletes its pthread key. That function runs even on process exit, and it can run before other destructor functions and before C++ static object destructors. Move the destructor function to crtbegin_so.c, where an __attribute__((destructor)) function is only called on dlclose. Use a priority 0 destructor, which runs after every destructor with a default or greater priority value. __emutls_unregister_key will still run before destructor functions of DT_NEEDED solibs. It also still leaks memory (both the emutls arrays and each emutls object). Bug: b/80453944 Test: manual Change-Id: I6789bcf168415ab8badf2f64687c6a0136c5c917 |
||
---|---|---|
.. | ||
__dso_handle.h | ||
__dso_handle_so.h | ||
asm_multiarch.h | ||
atexit.h | ||
crtbegin.c | ||
crtbegin_so.c | ||
crtbrand.S | ||
crtend.S | ||
crtend_so.S | ||
pthread_atfork.h |