parent
49a5efff46
commit
4d0cdb011f
|
@ -85,7 +85,7 @@ public class Spider implements Runnable, Task {
|
|||
|
||||
protected AtomicInteger stat = new AtomicInteger(STAT_INIT);
|
||||
|
||||
protected boolean exitWhenComplete = true;
|
||||
protected volatile boolean exitWhenComplete = true;
|
||||
|
||||
protected final static int STAT_INIT = 0;
|
||||
|
||||
|
@ -598,6 +598,13 @@ public class Spider implements Runnable, Task {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop when all tasks in the queue are completed and all worker threads are also completed
|
||||
*/
|
||||
public void stopWhenComplete(){
|
||||
this.exitWhenComplete = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* start with more than one threads
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue