Пример #1
0
        /// <summary>
        /// Gets the thread-local dictionary
        /// </summary>
        /// <param name="create">Must be true for any subsequent dictionary modification operation</param>
        /// <returns></returns>
        private static IDictionary <string, object> GetThreadDictionary(bool create = true)
        {
            var dictionary = ThreadLocalStorageHelper.GetDataForSlot <Dictionary <string, object> >(dataSlot, create);

            if (dictionary == null && !create)
            {
                return(EmptyDefaultDictionary);
            }

            return(dictionary);
        }
Пример #2
0
 private static Stack <object> GetThreadStack(bool create = true)
 {
     return(ThreadLocalStorageHelper.GetDataForSlot <Stack <object> >(dataSlot, create));
 }
Пример #3
0
 /// <summary>
 /// Gets the thread-local dictionary
 /// </summary>
 /// <param name="create">Must be true for any subsequent dictionary modification operation</param>
 /// <returns></returns>
 private static IDictionary <string, object> GetThreadDictionary(bool create = true)
 {
     return(ThreadLocalStorageHelper.GetDataForSlot <Dictionary <string, object> >(DataSlot, create));
 }