Propagating ThreadLocal to a new Thread fetched from a ExecutorService

后端 未结 6 760
傲寒
傲寒 2020-12-02 11:31

I\'m running a process in a separate thread with a timeout, using an ExecutorService and a Future (example code here) (the thread \"spawning\" takes place in a AOP Aspect).<

6条回答
  •  不知归路
    2020-12-02 11:55

    As I understand your problem, you can have a look at InheritableThreadLocal which is meant to pass ThreadLocal variables from Parent Thread context to Child Thread Context

提交回复
热议问题