Make thread locals easier to manage
Merge pull request #222 from halorgium/thread-local-management

Make thread locals easier to manage