update threadlocal