I am using a
ThreadLocal<T> to store an item-per-thread, but every soft often, I wish to clear a thread's stored value. How is the best way of doing this? I can reset the instance's value to null, but the IsValueCreated property still shows true.
var storage = new ThreadLocal<string>(); storage.Value = "hello"; //storage.IsValueCreated -> true storage.Value = null; //storage.IsValueCreated -> still true