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

master
yihua.huang 2014-04-16 18:13:51 +08:00
commit bc8d0220eb
1 changed files with 6 additions and 6 deletions

View File

@ -489,17 +489,17 @@ public class Spider implements Runnable, Task {
}
private void waitNewUrl() {
newUrlLock.lock();
try {
newUrlLock.lock();
//double check
if (threadAlive.get() == 0 && exitWhenComplete) {
return;
}
try {
newUrlCondition.await();
} catch (InterruptedException e) {
}
} finally {
newUrlCondition.await();
} catch (InterruptedException e) {
logger.warn("waitNewUrl - interrupted, error {}", e);
}
finally {
newUrlLock.unlock();
}
}