22 namespace Lucene.Net.Support.Compatibility
24 public class ThreadLocal<T> : IDisposable
27 static WeakDictionary<ThreadLocal<T>, T> slots;
31 if (slots == null) slots =
new WeakDictionary<ThreadLocal<T>, T>();
39 slots.Add(
this, value);
44 return (T)slots[
this];
50 if (slots != null) slots.Remove(
this);