Add docs and api on threadlocals