a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java
final void externalPush(ForkJoinTask<?> task) {
        WorkQueue[] ws; WorkQueue q; int m;
        int r = ThreadLocalRandomHelper.getProbe();
        int rs = runState;
        if ((ws = workQueues) != null && (m = (ws.length - 1)) >= 0 &&
            (q = ws[m & r & SQMASK]) != null && r != 0 && rs > 0 &&
            U.compareAndSwapInt(q, QLOCK, 0, 1)) {
            ForkJoinTask<?>[] a; int am, n, s;
            if ((a = q.array) != null &&
                (am = a.length - 1) > (n = (s = q.top) - q.base)) {
                int j = ((am & s) << ASHIFT) + ABASE;
                U.putOrderedObject(a, j, task);
                U.putOrderedInt(q, QTOP, s + 1);
                U.putIntVolatile(q, QLOCK, 0);
                if (n <= 1)
                    signalWork(ws, q);
                return;
            }
            U.compareAndSwapInt(q, QLOCK, 1, 0);
        }
        externalSubmit(task);
    }
final void externalPush(ForkJoinTask<?> task) {
        WorkQueue[] ws; WorkQueue q; int m;
        int r = ThreadLocalRandomHelper.getProbe();
        int rs = runState;
        if ((ws = workQueues) != null && (m = (ws.length - 1)) >= 0 &&
            (q = ws[m & r & SQMASK]) != null && r != 0 && rs > 0 &&
            U.compareAndSwapInt(q, QLOCK, 0, 1)) {
            ForkJoinTask<?>[] a; int am, n, s;
            if ((a = q.array) != null &&
                (am = a.length - 1) > (n = (s = q.top) - q.base)) {
                int j = ((am & s) << ASHIFT) + ABASE;
                U.putOrderedObject(a, j, task);
                U.putOrderedInt(q, QTOP, s + 1);
                U.putIntVolatile(q, QLOCK, 0);
                if (n <= 1)
                    signalWork(ws, q);
                return;
            }
            U.compareAndSwapInt(q, QLOCK, 1, 0);
        }
        externalSubmit(task);
    }
final void externalPush ( ForkJoinTask < ? > task ) { WorkQueue [ ] ws ; WorkQueue q ; int m ; int r = ThreadLocalRandomHelper . getProbe ( ) ; int rs = runState ; if ( ( ws = workQueues ) != null && ( m = ( ws . length - 1 ) ) >= 0 && ( q = ws [ m & r & SQMASK ] ) != null && r != 0 && rs > 0 && U . compareAndSwapInt ( q , QLOCK , 0 , 1 ) ) { ForkJoinTask < ? > [ ] a ; int am , n , s ; if ( ( a = q . array ) != null && ( am = a . length - 1 ) > ( n = ( s = q . top ) - q . base ) ) { int j = ( ( am & s ) << ASHIFT ) + ABASE ; U . putOrderedObject ( a , j , task ) ; U . putOrderedInt ( q , QTOP , s + 1 ) ; U . putIntVolatile ( q , QLOCK , 0 ) ; if ( n <= 1 ) signalWork ( ws , q ) ; return ; } U . compareAndSwapInt ( q , QLOCK , 1 , 0 ) ; } externalSubmit ( task ) ; }
Tries to add the given task to a submission queue at
submitter's current queue. Only the (vastly) most common path
is directly handled in this method, while screening for need
for externalSubmit.

@param task the task. Caller must ensure non-null.
Tries to add the given task to a submission queue at submitter s current queue . Only the ( vastly ) most common path is directly handled in this method while screening for need for externalSubmit .