public ThreadLocal(Func <T> initializer) { if (initializer == null) { throw new ArgumentNullException("initializer"); } localStore = Thread.AllocateDataSlot(); this.initializer = initializer; }
public ThreadLocal(Func <T> valueFactory) { if (valueFactory == null) { throw new ArgumentNullException("valueFactory"); } localStore = Thread.AllocateDataSlot(); this.valueFactory = valueFactory; }
private ThreadLocal(Func <T> valueFactory, bool initCachedException) { if (initCachedException) { cachedException = new ThreadLocal <Exception>(ThreadLocal <Exception> .InitDefault, false); } if (valueFactory == null) { throw new ArgumentNullException("valueFactory"); } localStore = Thread.AllocateDataSlot(); this.valueFactory = valueFactory; }
public TLSHolder() { this.m_slot = Thread.AllocateDataSlot(); }