Example #1
0
 private static void RemoveDomainLocalStore(LocalDataStore dls)
 {
     if (dls != null)
     {
         LocalDataStoreManager.DeleteLocalDataStore(dls);
     }
 }
Example #2
0
        public static void SetData(LocalDataStoreSlot slot, object data)
        {
            LocalDataStore domainLocalStore = GetDomainLocalStore();

            if (domainLocalStore == null)
            {
                domainLocalStore = LocalDataStoreManager.CreateLocalDataStore();
                SetDomainLocalStore(domainLocalStore);
            }
            domainLocalStore.SetData(slot, data);
        }
Example #3
0
        public static object GetData(LocalDataStoreSlot slot)
        {
            LocalDataStoreManager.ValidateSlot(slot);
            LocalDataStore domainLocalStore = GetDomainLocalStore();

            if (domainLocalStore == null)
            {
                return(null);
            }
            return(domainLocalStore.GetData(slot));
        }
        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));
        }
Example #6
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);
        }
Example #7
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));
        }
Example #8
0
 /*=========================================================================
 ** Frees a named data slot. The slot is allocated on ALL the
 ** threads.  Named data slots are "public" and can be manipulated by
 ** anyone.
 ** =========================================================================*/
 public static void FreeNamedDataSlot(String name)
 {
     LocalDataStoreManager.FreeNamedDataSlot(name);
 }
Example #9
0
 /*=========================================================================
 ** Looks up a named data slot. If the name has not been used, a new slot is
 ** allocated.  Named data slots are "public" and can be manipulated by
 ** anyone.
 ** =========================================================================*/
 public static LocalDataStoreSlot GetNamedDataSlot(String name)
 {
     return(LocalDataStoreManager.GetNamedDataSlot(name));
 }
Example #10
0
 /*=========================================================================
 ** Allocates a named data slot. The slot is allocated on ALL the
 ** threads.  Named data slots are "public" and can be manipulated by
 ** anyone.
 ** =========================================================================*/
 public static LocalDataStoreSlot AllocateNamedDataSlot(String name)
 {
     return(LocalDataStoreManager.AllocateNamedDataSlot(name));
 }
Example #11
0
 /*=========================================================================
 ** Allocates an un-named data slot. The slot is allocated on ALL the
 ** threads.
 ** =========================================================================*/
 public static LocalDataStoreSlot AllocateDataSlot()
 {
     return(LocalDataStoreManager.AllocateDataSlot());
 }