wiring threadlocals and fixing some lifecycles
6 files changed