I am running a ThreadPoolExecutor with a number of Threads. I want to manipulate some data in the Threads, so I want to send an object to the thread and after it finishes use the data. The only way I know how is to wait until the thread finished with join() and then use the data. The problem is, that I can't get a single thread from the ThreadPoolExecutor. I would like to do something like this:
Thread t = ThreadPoolExecutor.getThread();
t.start();
t.join();
rest of code....
Does anyone have a way? I know that I can use Callable but I want to avoid this, as I already have pre-existing code...