mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
update
This commit is contained in:
parent
77645da2bd
commit
68a1ece57c
@ -224,6 +224,9 @@ public class CrawlServiceImpl implements CrawlService {
|
|||||||
boolean isFindBookId = bookIdMatcher.find();
|
boolean isFindBookId = bookIdMatcher.find();
|
||||||
while (isFindBookId) {
|
while (isFindBookId) {
|
||||||
try {
|
try {
|
||||||
|
//1.阻塞过程(使用了 sleep,同步锁的 wait,socket 中的 receiver,accept 等方法时)
|
||||||
|
//捕获中断异常InterruptedException来退出线程。
|
||||||
|
//2.非阻塞过程中通过判断中断标志来退出线程。
|
||||||
if(Thread.currentThread().isInterrupted()){
|
if(Thread.currentThread().isInterrupted()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user