Commit bc8d0220 authored by yihua.huang's avatar yihua.huang

Merge branch 'master' of github.com:code4craft/webmagic

parents 1fbfc92d 93c4a2af
...@@ -489,17 +489,17 @@ public class Spider implements Runnable, Task { ...@@ -489,17 +489,17 @@ public class Spider implements Runnable, Task {
} }
private void waitNewUrl() { private void waitNewUrl() {
try {
newUrlLock.lock(); newUrlLock.lock();
try {
//double check //double check
if (threadAlive.get() == 0 && exitWhenComplete) { if (threadAlive.get() == 0 && exitWhenComplete) {
return; return;
} }
try {
newUrlCondition.await(); newUrlCondition.await();
} catch (InterruptedException e) { } catch (InterruptedException e) {
logger.warn("waitNewUrl - interrupted, error {}", e);
} }
} finally { finally {
newUrlLock.unlock(); newUrlLock.unlock();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment