change __thread into thread_local