code: public void forceTermination() {
          // Only need to change root state
          final Phaser root = this.root;
          long s;
          while ((s = root.state) >= 0) {
              if (U.compareAndSwapLong(root, STATE, s, s | TERMINATION_BIT)) {
                  // signal all threads
                  releaseWaiters(0); // Waiters on evenQ
                  releaseWaiters(1); // Waiters on oddQ
                  return;
              }
          }
      }
docs: Forces this phaser to enter termination state.  Counts of
  registered parties are unaffected.  If this phaser is a member
  of a tiered set of phasers, then all of the phasers in the set
  are terminated.  If this phaser is already terminated, this
  method has no effect.  This method may be useful for
  coordinating recovery after one or more tasks encounter
  unexpected exceptions.