Using InheritableThreadLocal with ThreadPoolExecutor — or — a ThreadPoolExecutor that doesn't reuse threads

前端 未结 4 1991
盖世英雄少女心
盖世英雄少女心 2020-12-10 01:58

I am trying to use both InheritableThreadLocal and a ThreadPoolExecutor.

This breaks down because ThreadPoolExecutor reuses th

4条回答
  •  眼角桃花
    2020-12-10 02:32

    Why not just pass the current connection on to any sub-tasks spawned by the main task? maybe some sort of shared Context object?

提交回复
热议问题