What is the correct way to dispose elements held inside a ThreadLocal?
I had a look at the code in ThreadLocal<T> to see what the current Dispose is doing and it appears to be a lot of voodoo. Obviously disposing of thread-related stuff. But it doesn’t dispose of the values if T itself is disposable. Now, I have a solution – a ThreadLocalDisposables<T> class, but before I … Read more