introduced ThreadLocalScope for hooking in thread local resources