AllocateDataSlot() public static method

public static AllocateDataSlot ( ) : System.LocalDataStoreSlot
return System.LocalDataStoreSlot
示例#1
0
        public ThreadLocal(Func <T> initializer)
        {
            if (initializer == null)
            {
                throw new ArgumentNullException("initializer");
            }

            localStore       = Thread.AllocateDataSlot();
            this.initializer = initializer;
        }
示例#2
0
        public ThreadLocal(Func <T> valueFactory)
        {
            if (valueFactory == null)
            {
                throw new ArgumentNullException("valueFactory");
            }

            localStore        = Thread.AllocateDataSlot();
            this.valueFactory = valueFactory;
        }
示例#3
0
        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;
        }
示例#4
0
 public TLSHolder()
 {
     this.m_slot = Thread.AllocateDataSlot();
 }