Use thread_local to store thread name.