mirror of
https://gitee.com/novel_dev_team/novel-plus
synced 2026-07-20 17:54:59 +08:00
update
This commit is contained in:
@@ -224,6 +224,9 @@ public class CrawlServiceImpl implements CrawlService {
|
||||
boolean isFindBookId = bookIdMatcher.find();
|
||||
while (isFindBookId) {
|
||||
try {
|
||||
//1.阻塞过程(使用了 sleep,同步锁的 wait,socket 中的 receiver,accept 等方法时)
|
||||
//捕获中断异常InterruptedException来退出线程。
|
||||
//2.非阻塞过程中通过判断中断标志来退出线程。
|
||||
if(Thread.currentThread().isInterrupted()){
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user