Class ThreadLocalRunnable

  • All Implemented Interfaces:
    Runnable

    public class ThreadLocalRunnable
    extends Object
    implements Runnable
    Copies a ThreadLocal value from the current thread onto the thread that runs the provided runnable.
    See Also:
    ThreadLocal
    • Constructor Detail

      • ThreadLocalRunnable

        public ThreadLocalRunnable​(Runnable task,
                                   ThreadLocal<?> threadLocal)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable