The internal data structure that stores the thread-local variables for Netty and all {@link FastThreadLocal}s. Note that this class is for internal use only and is subject to change at any time. Use {@link FastThreadLocal} unless you know what you are doing.
Exemplo n.º 1
0
 public static InternalThreadLocalMap Get()
 {
     InternalThreadLocalMap ret = slowThreadLocalMap;
     if (ret == null)
     {
         ret = new InternalThreadLocalMap();
         slowThreadLocalMap = ret;
     }
     return ret;
 }
Exemplo n.º 2
0
        protected static void RemoveFromVariablesToRemove(InternalThreadLocalMap threadLocalMap,
            FastThreadLocal variable)
        {
            object v = threadLocalMap.GetIndexedVariable(VariablesToRemoveIndex);

            if (v == InternalThreadLocalMap.Unset || v == null)
            {
                return;
            }

            var variablesToRemove = (HashSet<FastThreadLocal>) v;
            variablesToRemove.Remove(variable);
        }
Exemplo n.º 3
0
        protected static void AddToVariablesToRemove(InternalThreadLocalMap threadLocalMap, FastThreadLocal variable)
        {
            object v = threadLocalMap.GetIndexedVariable(VariablesToRemoveIndex);
            HashSet<FastThreadLocal> variablesToRemove;
            if (v == InternalThreadLocalMap.Unset || v == null)
            {
                variablesToRemove = new HashSet<FastThreadLocal>();
                    // Collections.newSetFromMap(new IdentityHashMap<FastThreadLocal<?>, Boolean>());
                threadLocalMap.SetIndexedVariable(VariablesToRemoveIndex, variablesToRemove);
            }
            else
            {
                variablesToRemove = (HashSet<FastThreadLocal>) v;
            }

            variablesToRemove.Add(variable);
        }
Exemplo n.º 4
0
 /// <summary>
 ///     Sets the value to uninitialized; a proceeding call to get() will trigger a call to GetInitialValue().
 /// </summary>
 /// <param name="threadLocalMap"></param>
 public abstract void Remove(InternalThreadLocalMap threadLocalMap);
Exemplo n.º 5
0
 public static void Destroy() => slowThreadLocalMap = null;
Exemplo n.º 6
0
 public static void Remove() => slowThreadLocalMap = null;
Exemplo n.º 7
0
 public static void Destroy() => slowThreadLocalMap = null;
Exemplo n.º 8
0
 public static void Remove() => slowThreadLocalMap = null;
Exemplo n.º 9
0
 /// <summary>
 ///     Sets the value to uninitialized; a proceeding call to get() will trigger a call to GetInitialValue().
 /// </summary>
 /// <param name="threadLocalMap"></param>
 public abstract void Remove(InternalThreadLocalMap threadLocalMap);
Exemplo n.º 10
0
 /// Destroys the data structure that keeps all {@link FastThreadLocal} variables accessed from
 /// non-{@link FastThreadLocalThread}s.  This operation is useful when you are in a container environment, and you
 /// do not want to leave the thread local variables in the threads you do not manage.  Call this method when your
 /// application is being unloaded from the container.
 public static void Destroy() => InternalThreadLocalMap.Destroy();