Revert thread_local stuff