On 08/05/2011 04:24 PM, Torvald Riegel wrote: > Note that I did have code ready to have a single statically allocated > __thread gtm_thread object. However, I then saw that unlike discussed > off-list, the compiler does indeed complain about using non-trivial > objects with __thread (which makes sense). Is there a way to avoid this > and use the explicit dtors calls and ctor calls via placement new?
Maybe. It seems awfully hackish though. > Assuming that this is not possible, I'd rather want objects to have > constructors (e.g., for the vectors, aa_tree, etc.) than to avoid the > __thread helper object (gtm_thread_tls in config/generic/tls.h, only for > targets without fast access to two TLS slots) by having statically > allocated __thread gtm_thread objects. Sure. The patch is ok. r~