How to stop a thread after it has completed the runnable?

前端 未结 1 801
臣服心动
臣服心动 2021-01-16 09:04

I have a list of tasks and a limited number of threads. The goal is to time how long the tasks take to finish using this number of threads.

I know something is wr

1条回答
  •  北海茫月
    2021-01-16 09:44

    You don't need to.. After thread has completed the run() method of Runnable, it should be completed. The OOM error you are facing is something to do with the logic inside the run() method of the Runnable.

    0 讨论(0)
提交回复
热议问题