Reputation: 511
I got a pool of threads using ExecutorService, this executorService will execute the runnable class I implemented, and now I'd like to get the currently running thread in this pool, how? Please help, thanks.
Thread currThread = Thread.currentThread();
Will this get the current running thread in the pool?
Upvotes: 0
Views: 226
Reputation: 1954
Thread currThread = Thread.currentThread()
write the above code in your part of code which is shared between pool of threads.
Upvotes: 1