code: public void stop() {
          if (!this.isActive) {
              return;
          }
  
          cpuThread.shutdown();
  
          try {
              Thread.sleep(40);
          } catch (InterruptedException e) {
          }
  
          for (int i = 0; i < taskQueues.length; i++)
              taskQueues[i].clear();
  
          heartBeatQueue.clear();
      }
docs: Stops scheduler.