Methods Summary |
---|
public void | loopDoRange(int start, int end)
|
protected synchronized PoolLoopHandler$LoopRange | loopGetRange()
if (curLoop >= endLoop)
return null;
LoopRange ret = new LoopRange();
ret.start = curLoop;
curLoop += (endLoop-startLoop)/numThreads+1;
ret.end = (curLoop<endLoop)?curLoop:endLoop;
return ret;
|
public void | loopProcess()
reset();
for (int i = 0; i < numThreads; i++) {
poolThreads.addRequest(this);
}
try {
poolThreads.waitForAll();
} catch (InterruptedException iex) {
iex.printStackTrace();
}
|
public synchronized void | reset()
curLoop = startLoop;
|
public void | run()
LoopRange str;
while ((str = loopGetRange()) != null) {
loopDoRange(str.start, str.end);
}
|
public synchronized void | setRange(int start, int end)
startLoop = start;
endLoop = end;
reset();
|