Helios.Util.InternalThreadLocalMap.GetIndexedVariable C# (CSharp) Method

GetIndexedVariable() private method

private GetIndexedVariable ( int index ) : object
index int
return object
        public object GetIndexedVariable(int index)
        {
            object[] lookup = this.indexedVariables;
            return index < lookup.Length ? lookup[index] : Unset;
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        ///     Removes all {@link FastThreadLocal} variables bound to the current thread.  This operation is useful when you
        ///     are in a container environment, and you don't want to leave the thread local variables in the threads you do not
        ///     manage.
        /// </summary>
        public static void RemoveAll()
        {
            InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.GetIfSet();

            if (threadLocalMap == null)
            {
                return;
            }

            try
            {
                object v = threadLocalMap.GetIndexedVariable(VariablesToRemoveIndex);
                if (v != null && v != InternalThreadLocalMap.Unset)
                {
                    var variablesToRemove = (HashSet <FastThreadLocal>)v;
                    foreach (FastThreadLocal tlv in variablesToRemove) // todo: do we need to make a snapshot?
                    {
                        tlv.Remove(threadLocalMap);
                    }
                }
            }
            finally
            {
                InternalThreadLocalMap.Remove();
            }
        }
All Usage Examples Of Helios.Util.InternalThreadLocalMap::GetIndexedVariable