摘要: ThreadPoolExecutor提供了四个构造方法: 我们以最后一个构造方法(参数最多的那个),对其参数进行解释: public ThreadPoolExecutor(int corePoolSize, // 1 int maximumPoolSize, // 2 long keepAliveT 阅读全文
posted @ 2021-05-14 16:10 satire 阅读(101) 评论(0) 推荐(0)
摘要: 如何安全的结束一个正在运行的线程 java.lang.Thread类包含了一些常用的方法,如:start(), stop(), stop(Throwable) ,suspend(), destroy() ,resume()。通过这些方法,我们可以对线程进行方便的操作,但是这些方法中,只有start( 阅读全文
posted @ 2021-05-14 15:27 satire 阅读(128) 评论(0) 推荐(0)