Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Run thread dtors in reverse order

2024-12-11 Thread Martin Storsjö
On Fri, 6 Dec 2024, LIU Hao wrote: 在 2024-12-06 07:20, Martin Storsjö 写道: Thanks - so I guess this patch could be pushed on its own, even if we don't yet figure out a good way forward with the other one. This patch is OK for me. (because it's simple; not because it's perfect.) Ok, I pushed

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Run thread dtors in reverse order

2024-12-06 Thread LIU Hao
在 2024-12-06 07:20, Martin Storsjö 写道: Thanks - so I guess this patch could be pushed on its own, even if we don't yet figure out a good way forward with the other one. This patch is OK for me. (because it's simple; not because it's perfect.) If we could force libstdc++ to prefer providing it

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Run thread dtors in reverse order

2024-12-05 Thread Martin Storsjö
On Thu, 5 Dec 2024, LIU Hao wrote: 在 2024-12-05 20:38, Martin Storsjö 写道: When the libstdc++/libsupc++ implementation of __cxa_thread_atexit is used in conjunction with emulated TLS, both emutls and libsupc++ register destructors to be executed via pthread_key_create; one for freeing the per-th

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Run thread dtors in reverse order

2024-12-05 Thread LIU Hao
在 2024-12-05 20:38, Martin Storsjö 写道: When the libstdc++/libsupc++ implementation of __cxa_thread_atexit is used in conjunction with emulated TLS, both emutls and libsupc++ register destructors to be executed via pthread_key_create; one for freeing the per-thread memory allocated for the TLS obj

[Mingw-w64-public] [PATCH 2/2] winpthreads: Run thread dtors in reverse order

2024-12-05 Thread Martin Storsjö
According to docs, the order is unspecified, but running them in reverse order would be more logical. When libstdc++ is built, it can either provide its own implementation of __cxa_thread_atexit or use one from the host environment. When libstdc++ is cross compiled, the configure script doesn't d