How does a parent thread in a thread pool obtain data stored in thread local by a child thread

57 views Asked by At

I have a threadlocal that records logs, and I want to add all logs of this request to the return result when returning the result. Normal use is no problem, but when using thread pool, due to the characteristics of threadlocal, the logs printed in the child thread are stored in the threadlocal of the child thread. How can I get the log data saved by the child threads to thread local in the main thread

0

There are 0 answers