private static void RemoveDomainLocalStore(LocalDataStore dls) { if (dls != null) { LocalDataStoreManager.DeleteLocalDataStore(dls); } }
public static void SetData(LocalDataStoreSlot slot, object data) { LocalDataStore domainLocalStore = GetDomainLocalStore(); if (domainLocalStore == null) { domainLocalStore = LocalDataStoreManager.CreateLocalDataStore(); SetDomainLocalStore(domainLocalStore); } domainLocalStore.SetData(slot, data); }
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)); }
/*========================================================================= ** 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); }
/*========================================================================= ** 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)); }
/*========================================================================= ** 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); }
/*========================================================================= ** 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)); }
/*========================================================================= ** 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)); }
/*========================================================================= ** Allocates an un-named data slot. The slot is allocated on ALL the ** threads. ** =========================================================================*/ public static LocalDataStoreSlot AllocateDataSlot() { return(LocalDataStoreManager.AllocateDataSlot()); }