add a thread_local feature gate