FileDocCategorySizeDatePackage
PoolSelfLoopHandler.javaAPI DocExample691Thu Mar 11 19:50:56 GMT 2004javathreads.examples.ch15

PoolSelfLoopHandler

public class PoolSelfLoopHandler extends PoolLoopHandler

Fields Summary
private int
groupSize
Constructors Summary
public PoolSelfLoopHandler(int start, int end, int size, int threads)

        super(start, end, threads);
        setSize(size);
    
Methods Summary
protected synchronized LoopRangeloopGetRange()

        if (curLoop >= endLoop)
            return null;
        LoopRange ret = new LoopRange();
        ret.start = curLoop;
        curLoop += groupSize;
        ret.end = (curLoop<endLoop)?curLoop:endLoop;
        return ret;
    
public synchronized voidsetSize(int size)

        groupSize = size;
        reset();