Pattern for managing thread local storage?

There are a couple of solutions discussed in Thread safe buffer correctness