Hi,

I have a executorservice build from threadpoolbuilder.

public ExecutorService jobThreadPool() throws Exception {
    return new 
ThreadPoolBuilder(getContext()).poolSize(50).maxPoolSize(500).keepAliveTime(180).build("jobThread");
}

I would like to set thread before executing the task, just like as shown

in example which is not recommended. How can we do it correctly? (like
in 
https://stackoverflow.com/questions/8523453/with-threadpoolexecutor-how-to-get-the-name-of-the-thread-running-in-the-thread)

jobThreadPool.execute(() -> {
//eg. Thread.getCurrentThread().setName("abc");
});

Reply via email to