0

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?

Ivy
  • 503
  • 1
  • 10
  • 23

1 Answers1

1
Thread currThread  = Thread.currentThread()

write the above code in your part of code which is shared between pool of threads.

Malatesh
  • 1,944
  • 6
  • 26
  • 39