Like this.
struct some_struct { // Other fields ..... __thread int tl; }
I\'m trying to do that but the compiler is giving me this error
You can also specify the struct itself as thread local. For example;
#include thread_local struct gl_i_t{ int a; int b; }GL_i_t;
Then you can use GL_i_t variables inside thread.