Deadlock in ThreadPoolExecutor

前端 未结 6 1900
温柔的废话
温柔的废话 2020-12-24 15:44

Encountered a situation when ThreadPoolExecutor is parked in execute(Runnable) function while all the ThreadPool threads are waiting i

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 16:11

    As someone already mentioned, this sounds like normal behaviour, the ThreadPoolExecutor is just waiting to do some work. If you want to stop it, you need to call:

    executor.shutdown()

    to get it to terminate, usually followed by a executor.awaitTermination

提交回复
热议问题