On Wed, 28 Oct 2020, Martin Storsjö wrote:

> Don't run the destructors directly after executing the user thread
> function. This allows running other TLS callbacks (e.g. tls_atexit.c)
> before running destructors registered via pthread_key_create (which
> can be used by the libgcc emutls allocations, if libgcc is built with
> the pthread thread model).


This does not work for me if winpthreads is dynamically linked.  In that
case, winpthread DLL's __dyn_tls_callback is called before the
executable's tls_callback, so emutls_destroy is still called before the
executable's tls destructors are processed.  It works properly if
winpthreads is  statically linked though.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to