Class FastThreadLocal<T>

java.lang.Object
java.lang.ThreadLocal<T>
com.xpdustry.claj.common.util.FastThreadLocal<T>

public class FastThreadLocal<T> extends ThreadLocal<T>
ThreadLocal with MRU fast path.
  • Field Details

    • supplier

      protected final arc.func.Prov<T> supplier
  • Constructor Details

    • FastThreadLocal

      public FastThreadLocal()
    • FastThreadLocal

      public FastThreadLocal(arc.func.Prov<T> supplier)
  • Method Details

    • with

      public static <T> FastThreadLocal<T> with(arc.func.Prov<T> supplier)
    • initialValue

      protected T initialValue()
      Overrides:
      initialValue in class ThreadLocal<T>
    • get

      public T get()
      Overrides:
      get in class ThreadLocal<T>
    • set

      public void set(T value)
      Overrides:
      set in class ThreadLocal<T>
    • remove

      public void remove()
      Overrides:
      remove in class ThreadLocal<T>
    • getCurrent

      protected long getCurrent()
    • tryUpdate

      protected void tryUpdate(long current, T val)
    • tryRemove

      protected void tryRemove(long current)