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

[Mingw-w64-public] Cannot access member of struct from deriving class, is this a bug?

2024-12-05 Thread info
The following seems to only not work in GCC (neither MinGW nor native GCC), but it compiles fine in MSVC. ``` template struct A { int numElements; T* elements; }; template class B : public A { B(int newNumElements) { numElements = newNumElements; // This fails with error.

Re: [Mingw-w64-public] [PATCH 1/2] [RFC] winpthreads: Don't run cleanup routines immediately for native posix threads

2024-12-05 Thread Jeremy Drake via Mingw-w64-public
On Thu, 5 Dec 2024, Martin Storsjö wrote: > When the destructors of the TLS objects are executed via > mingw-w64-crt's __cxa_thread_atexit, those destructors are executed > via a TLS callback, after the point when emutls has deallocated > their storage memory. > Unfortunately, this isn't enough t

[Mingw-w64-public] [PATCH] headers: Add new symbols in processthreadsapi.h

2024-12-05 Thread Biswapriyo Nath
From fe5b01498031e3ba2c7cecef627671c1ba5c0007 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 5 Dec 2024 17:38:42 + Subject: [PATCH] headers: Add new symbols in processthreadsapi.h Signed-off-by: Biswapriyo Nath --- mingw-w64-headers/include/processthreadsapi.h | 14 +++--

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

Re: [Mingw-w64-public] [PATCH 1/2] [RFC] winpthreads: Don't run cleanup routines immediately for native posix threads

2024-12-05 Thread Martin Storsjö
> On 5. Dec 2024, at 14.38, Martin Storsjö wrote: > > Within winpthreads, a native posix thread is a thread that has > been created via pthread_create. > > Previously, pthread key destructors were executed immediately when > the thread exits, for native posix threads. For non-posix native > thre

[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

[Mingw-w64-public] [PATCH 1/2] [RFC] winpthreads: Don't run cleanup routines immediately for native posix threads

2024-12-05 Thread Martin Storsjö
Within winpthreads, a native posix thread is a thread that has been created via pthread_create. Previously, pthread key destructors were executed immediately when the thread exits, for native posix threads. For non-posix native threads (i.e. threads created via some other API than pthreads), the p