code: private void doSubmit(ForkJoinTask<?> task) {
          Submitter s = submitters.get();
          for (int r = s.seed, m = submitMask;;) {
              WorkQueue[] ws; WorkQueue q;
              int k = r & m & SQMASK;          // use only even indices
              if (runState < 0 || (ws = workQueues) == null || ws.length <= k)
                  throw new RejectedExecutionException(); // shutting down
              else if ((q = ws[k]) == null) {  // create new queue
                  WorkQueue nq = new WorkQueue(this, null, SHARED_QUEUE);
                  Mutex lock = this.lock;      // construct outside lock
                  lock.lock();
                  try {                        // recheck under lock
                      int rs = runState;       // to update seq
                      if (ws == workQueues && ws[k] == null) {
                          ws[k] = nq;
                          runState = ((rs & SHUTDOWN) | ((rs + 2) & ~SHUTDOWN));
                      }
                  } finally {
                      lock.unlock();
                  }
              }
              else if (q.trySharedPush(task)) {
                  signalWork();
                  return;
              }
              else if (m > 1) {                // move to a different index
                  r ^= r << 13;                // same xorshift as WorkQueues
                  r ^= r >>> 17;
                  s.seed = r ^= r << 5;
              }
              else
                  Thread.yield();              // yield if no alternatives
          }
      }
docs: Unless shutting down, adds the given task to a submission queue
  at submitter's current queue index (modulo submission
  range). If no queue exists at the index, one is created.  If
  the queue is busy, another index is randomly chosen. The
  submitMask bounds the effective number of queues to the
  (nearest power of two for) parallelism level.
  
  @param task the task. Caller must ensure non-null.