java.util.concurrent.CountedCompleter源码实例Demo

类java.util.concurrent.CountedCompleter源码实例Demo

下面列出了java.util.concurrent.CountedCompleter 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hottub   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    float[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码2 项目: Bytecoder   文件: ForEachOps.java
@Override
public void onCompletion(CountedCompleter<?> caller) {
    if (node != null) {
        // Dump buffered elements from this leaf into the sink
        node.forEach(action);
        node = null;
    }
    else if (spliterator != null) {
        // Dump elements output from this leaf's pipeline into the sink
        helper.wrapAndCopyInto(action, spliterator);
        spliterator = null;
    }

    // The completion of this task *and* the dumping of elements
    // "happens-before" completion of the associated left-most leaf task
    // of right subtree (if any, which can be this task's right sibling)
    //
    ForEachOrderedTask<S, T> leftDescendant = completionMap.remove(this);
    if (leftDescendant != null)
        leftDescendant.tryComplete();
}
 
源代码3 项目: Bytecoder   文件: WhileOps.java
@Override
public final void onCompletion(CountedCompleter<?> caller) {
    if (!isLeaf()) {
        Node<P_OUT> result;
        shortCircuited = leftChild.shortCircuited | rightChild.shortCircuited;
        if (isOrdered && canceled) {
            thisNodeSize = 0;
            result = getEmptyResult();
        }
        else if (isOrdered && leftChild.shortCircuited) {
            // If taking finished on the left node then
            // use the left node result
            thisNodeSize = leftChild.thisNodeSize;
            result = leftChild.getLocalResult();
        }
        else {
            thisNodeSize = leftChild.thisNodeSize + rightChild.thisNodeSize;
            result = merge();
        }

        setLocalResult(result);
    }

    completed = true;
    super.onCompletion(caller);
}
 
public final void compute() {
    CountedCompleter<?> s = this;
    Comparator<? super T> c = this.comparator;
    T[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger<T>(s, w, a, wb, h,
                                           wb+h, n-h, b, g, c));
        Relay rc = new Relay(new Merger<T>(fc, a, w, b+h, q,
                                           b+u, n-u, wb+h, g, c));
        new Sorter<T>(rc, a, w, b+u, n-u, wb+u, g, c).fork();
        new Sorter<T>(rc, a, w, b+h, q, wb+h, g, c).fork();;
        Relay bc = new Relay(new Merger<T>(fc, a, w, b, q,
                                           b+q, h-q, wb, g, c));
        new Sorter<T>(bc, a, w, b+q, h-q, wb+q, g, c).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    TimSort.sort(a, b, b + n, c, w, wb, n);
    s.tryComplete();
}
 
源代码5 项目: jdk8u60   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    int[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码6 项目: TencentKona-8   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    double[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码7 项目: Bytecoder   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    Comparator<? super T> c = this.comparator;
    T[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger<>(s, w, a, wb, h,
                                          wb+h, n-h, b, g, c));
        Relay rc = new Relay(new Merger<>(fc, a, w, b+h, q,
                                          b+u, n-u, wb+h, g, c));
        new Sorter<>(rc, a, w, b+u, n-u, wb+u, g, c).fork();
        new Sorter<>(rc, a, w, b+h, q, wb+h, g, c).fork();
        Relay bc = new Relay(new Merger<>(fc, a, w, b, q,
                                          b+q, h-q, wb, g, c));
        new Sorter<>(bc, a, w, b+q, h-q, wb+q, g, c).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    TimSort.sort(a, b, b + n, c, w, wb, n);
    s.tryComplete();
}
 
public final void compute() {
    CountedCompleter<?> s = this;
    short[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码9 项目: openjdk-jdk9   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    short[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码10 项目: jdk8u-jdk   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    int[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码11 项目: hottub   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    short[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码12 项目: jdk8u-dev-jdk   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    int[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码13 项目: Java8CN   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    long[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码14 项目: openjdk-jdk8u   文件: ForEachOps.java
@Override
public void onCompletion(CountedCompleter<?> caller) {
    if (node != null) {
        // Dump buffered elements from this leaf into the sink
        node.forEach(action);
        node = null;
    }
    else if (spliterator != null) {
        // Dump elements output from this leaf's pipeline into the sink
        helper.wrapAndCopyInto(action, spliterator);
        spliterator = null;
    }

    // The completion of this task *and* the dumping of elements
    // "happens-before" completion of the associated left-most leaf task
    // of right subtree (if any, which can be this task's right sibling)
    //
    ForEachOrderedTask<S, T> leftDescendant = completionMap.remove(this);
    if (leftDescendant != null)
        leftDescendant.tryComplete();
}
 
public final void compute() {
    CountedCompleter<?> s = this;
    long[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
public final void compute() {
    CountedCompleter<?> s = this;
    float[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
public final void compute() {
    CountedCompleter<?> s = this;
    long[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码18 项目: jdk8u-jdk   文件: ArraysParallelSortHelpers.java
public final void compute() {
    CountedCompleter<?> s = this;
    Comparator<? super T> c = this.comparator;
    T[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger<T>(s, w, a, wb, h,
                                           wb+h, n-h, b, g, c));
        Relay rc = new Relay(new Merger<T>(fc, a, w, b+h, q,
                                           b+u, n-u, wb+h, g, c));
        new Sorter<T>(rc, a, w, b+u, n-u, wb+u, g, c).fork();
        new Sorter<T>(rc, a, w, b+h, q, wb+h, g, c).fork();;
        Relay bc = new Relay(new Merger<T>(fc, a, w, b, q,
                                           b+q, h-q, wb, g, c));
        new Sorter<T>(bc, a, w, b+q, h-q, wb+q, g, c).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    TimSort.sort(a, b, b + n, c, w, wb, n);
    s.tryComplete();
}
 
public final void compute() {
    CountedCompleter<?> s = this;
    double[] a = this.a, w = this.w; // localize all params
    int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
    while (n > g) {
        int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
        Relay fc = new Relay(new Merger(s, w, a, wb, h,
                                        wb+h, n-h, b, g));
        Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
                                        b+u, n-u, wb+h, g));
        new Sorter(rc, a, w, b+u, n-u, wb+u, g).fork();
        new Sorter(rc, a, w, b+h, q, wb+h, g).fork();;
        Relay bc = new Relay(new Merger(fc, a, w, b, q,
                                        b+q, h-q, wb, g));
        new Sorter(bc, a, w, b+q, h-q, wb+q, g).fork();
        s = new EmptyCompleter(bc);
        n = q;
    }
    DualPivotQuicksort.sort(a, b, b + n - 1, w, wb, n);
    s.tryComplete();
}
 
源代码20 项目: openjdk-8   文件: SliceOps.java
@Override
public final void onCompletion(CountedCompleter<?> caller) {
    if (!isLeaf()) {
        Node<P_OUT> result;
        thisNodeSize = leftChild.thisNodeSize + rightChild.thisNodeSize;
        if (canceled) {
            thisNodeSize = 0;
            result = getEmptyResult();
        }
        else if (thisNodeSize == 0)
            result = getEmptyResult();
        else if (leftChild.thisNodeSize == 0)
            result = rightChild.getLocalResult();
        else {
            result = Nodes.conc(op.getOutputShape(),
                                leftChild.getLocalResult(), rightChild.getLocalResult());
        }
        setLocalResult(isRoot() ? doTruncate(result) : result);
        completed = true;
    }
    if (targetSize >= 0
        && !isRoot()
        && isLeftCompleted(targetOffset + targetSize))
            cancelLaterNodes();

    super.onCompletion(caller);
}
 
源代码21 项目: jdk8u-jdk   文件: FindOps.java
@Override
public void onCompletion(CountedCompleter<?> caller) {
    if (op.mustFindFirst) {
            for (FindTask<P_IN, P_OUT, O> child = leftChild, p = null; child != p;
                 p = child, child = rightChild) {
            O result = child.getLocalResult();
            if (result != null && op.presentPredicate.test(result)) {
                setLocalResult(result);
                foundResult(result);
                break;
            }
        }
    }
    super.onCompletion(caller);
}
 
源代码22 项目: jdk1.8-source-analysis   文件: ReduceOps.java
@Override
public void onCompletion(CountedCompleter<?> caller) {
    if (!isLeaf()) {
        S leftResult = leftChild.getLocalResult();
        leftResult.combine(rightChild.getLocalResult());
        setLocalResult(leftResult);
    }
    // GC spliterator, left and right child
    super.onCompletion(caller);
}
 
源代码23 项目: openjdk-jdk9   文件: ForkJoinPool8Test.java
public final void onCompletion(CountedCompleter caller) {
    CCF p = (CCF)getCompleter();
    int n = number + rnumber;
    if (p != null)
        p.rnumber = n;
    else
        number = n;
}
 
Sorter(CountedCompleter<?> par, T[] a, T[] w, int base, int size,
       int wbase, int gran,
       Comparator<? super T> comparator) {
    super(par);
    this.a = a; this.w = w; this.base = base; this.size = size;
    this.wbase = wbase; this.gran = gran;
    this.comparator = comparator;
}
 
源代码25 项目: jdk8u-dev-jdk   文件: ArraysParallelSortHelpers.java
Merger(CountedCompleter<?> par, int[] a, int[] w,
       int lbase, int lsize, int rbase,
       int rsize, int wbase, int gran) {
    super(par);
    this.a = a; this.w = w;
    this.lbase = lbase; this.lsize = lsize;
    this.rbase = rbase; this.rsize = rsize;
    this.wbase = wbase; this.gran = gran;
}
 
源代码26 项目: j2objc   文件: CountedCompleterTest.java
/**
 * getCompleter returns parent or null if at root
 */
public void testGetCompleter() {
    NoopCC a = new NoopCC();
    assertNull(a.getCompleter());
    CountedCompleter b = new NoopCC(a);
    assertSame(a, b.getCompleter());
    CountedCompleter c = new NoopCC(b);
    assertSame(b, c.getCompleter());
}
 
源代码27 项目: openjdk-jdk8u   文件: ArraysParallelSortHelpers.java
Merger(CountedCompleter<?> par, short[] a, short[] w,
       int lbase, int lsize, int rbase,
       int rsize, int wbase, int gran) {
    super(par);
    this.a = a; this.w = w;
    this.lbase = lbase; this.lsize = lsize;
    this.rbase = rbase; this.rsize = rsize;
    this.wbase = wbase; this.gran = gran;
}
 
源代码28 项目: j2objc   文件: SliceOps.java
@Override
public final void onCompletion(CountedCompleter<?> caller) {
    if (!isLeaf()) {
        Node<P_OUT> result;
        thisNodeSize = leftChild.thisNodeSize + rightChild.thisNodeSize;
        if (canceled) {
            thisNodeSize = 0;
            result = getEmptyResult();
        }
        else if (thisNodeSize == 0)
            result = getEmptyResult();
        else if (leftChild.thisNodeSize == 0)
            result = rightChild.getLocalResult();
        else {
            result = Nodes.conc(op.getOutputShape(),
                                leftChild.getLocalResult(), rightChild.getLocalResult());
        }
        setLocalResult(isRoot() ? doTruncate(result) : result);
        completed = true;
    }
    if (targetSize >= 0
        && !isRoot()
        && isLeftCompleted(targetOffset + targetSize))
            cancelLaterNodes();

    super.onCompletion(caller);
}
 
源代码29 项目: Java8CN   文件: ArraysParallelSortHelpers.java
Merger(CountedCompleter<?> par, float[] a, float[] w,
       int lbase, int lsize, int rbase,
       int rsize, int wbase, int gran) {
    super(par);
    this.a = a; this.w = w;
    this.lbase = lbase; this.lsize = lsize;
    this.rbase = rbase; this.rsize = rsize;
    this.wbase = wbase; this.gran = gran;
}
 
源代码30 项目: j2objc   文件: CountedCompleterTest.java
public final void onCompletion(CountedCompleter caller) {
    super.onCompletion(caller);
    CCF p = (CCF)getCompleter();
    int n = number + rnumber;
    if (p != null)
        p.number = n;
    else
        number = n;
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 同包方法