public static void SetData(LocalDataStoreSlot slot, object data)
        {
            LocalDataStoreHolder holder = s_LocalDataStore;

            if (holder == null)
            {
                holder           = LocalDataStoreManager.CreateLocalDataStore();
                s_LocalDataStore = holder;
            }
            holder.Store.SetData(slot, data);
        }
        public static object GetData(LocalDataStoreSlot slot)
        {
            LocalDataStoreHolder holder = s_LocalDataStore;

            if (holder == null)
            {
                LocalDataStoreManager.ValidateSlot(slot);
                return(null);
            }
            return(holder.Store.GetData(slot));
        }
Exemple #3
0
        /*=========================================================================
        ** Sets the data in the specified slot on the currently running thread, for that thread's current domain.
        ** =========================================================================*/
        public static void SetData(LocalDataStoreSlot slot, Object data)
        {
            LocalDataStoreHolder dls = s_LocalDataStore;

            // Create new DLS if one hasn't been created for this domain for this thread
            if (dls == null)
            {
                dls = LocalDataStoreManager.CreateLocalDataStore();
                s_LocalDataStore = dls;
            }

            dls.Store.SetData(slot, data);
        }
Exemple #4
0
        /*=========================================================================
        ** Retrieves the value from the specified slot on the current thread, for that thread's current domain.
        ** =========================================================================*/
        public static Object GetData(LocalDataStoreSlot slot)
        {
            LocalDataStoreHolder dls = s_LocalDataStore;

            if (dls == null)
            {
                // Make sure to validate the slot even if we take the quick path
                LocalDataStoreManager.ValidateSlot(slot);
                return(null);
            }

            return(dls.Store.GetData(slot));
        }