static __thread vars* ptr=NULL;void thread_init(vars* new_vars){ if(new_vars){ ptr=new_vars } printf("%p",ptr);}
__thread is GCC's extention
thread1 is one thread of main
thread1_child is child of thread1
call thread_init(a) in main //ptr is a, not NULL
call thread_init(b) in thread1 //ptr is b, not NULL
call thread_init(NULL) in thread1_child //ptr is NULL,not b
how to dynamically initialize(ptr of thread1 == ptr of thread1_child) ?