private int externalInterruptibleAwaitDone() throws InterruptedException {
        int s;
        ForkJoinPool cp = ForkJoinPool.common;
        if (Thread.interrupted())
            throw new InterruptedException();
        if ((s = status) >= 0 && cp != null) {
            if (this instanceof CountedCompleter)
                cp.externalHelpComplete((CountedCompleter<?>)this);
            else if (cp.tryExternalUnpush(this))
                doExec();
        }
        while ((s = status) >= 0) {
            if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
                synchronized (this) {
                    if (status >= 0)
                        wait();
                    else
                        notifyAll();
                }
            }
        }
        return s;
    }