thread-local storage: c++ front end

Richard Henderson rth@redhat.com
Wed May 22 11:31:00 GMT 2002


On Tue, May 21, 2002 at 11:00:06PM -0400, Jason Merrill wrote:
> So something like
> 
>   struct A {
>     static __thread int i;
>   };
> 
>   __thread int A::i = 42;
> 
>   template <typename T> struct B {
>     static __thread T t;
>   };
> 
>   template <typename T> 
>   __thread T B<T>::t = 42;
> 
>   int main ()
>   {
>     int j = B<int>::t;
>   }
> 
> ?

Yes, thanks.  I'll see what I can make of that.

> This should probably go in obscure_complex_init.

Hmm, ok.  I'd had that there at first, but then thought that
more things than constructors went through it.

> Any reason the tls tests need their own directory?  There are few enough
> that I'd tend to put them under special.

*shrug* There are only a few now, but it does seem like
categorization is a good thing.


r~



More information about the Gcc-patches mailing list