code: public void shutdown(boolean waitForJobsToComplete) {
  
          m_isShutdown = true;
  
          // signal each scheduler thread to shut down
          for (int i = 0; i < m_currentThreadCount; i++) {
              if (m_workers[i] != null) {
                  m_workers[i].shutdown();
              }
          }
  
          // give waiting (wait(1000)) worker threads a chance to shut down
          // active worker threads will shut down after finishing their
          // current job
          synchronized (m_nextRunnableLock) {
              m_nextRunnableLock.notifyAll();
          }
  
          if (waitForJobsToComplete) {
              // wait until all worker threads are shut down
              int alive = m_currentThreadCount;
              while (alive > 0) {
                  alive = 0;
                  for (int i = 0; i < m_currentThreadCount; i++) {
                      if (m_workers[i].isAlive()) {
                          try {
                              if (LOG.isDebugEnabled()) {
                                  LOG.debug(
                                      Messages.get().getBundle().key(Messages.LOG_THREAD_POOL_WAITING_1, new Integer(i)));
                              }
  
                              // note: with waiting infinite - join(0) - the application
                              // may appear to 'hang'
                              // waiting for a finite time however requires an additional loop (alive)
                              alive++;
                              m_workers[i].join(200);
                          } catch (InterruptedException e) {
                              // can be ignored
                          }
                      }
                  }
              }
  
              int activeCount = m_threadGroup.activeCount();
              if ((activeCount > 0) && LOG.isInfoEnabled()) {
                  LOG.info(
                      Messages.get().getBundle().key(Messages.LOG_THREAD_POOL_STILL_ACTIVE_1, new Integer(activeCount)));
              }
              if (LOG.isDebugEnabled()) {
                  LOG.debug(Messages.get().getBundle().key(Messages.LOG_THREAD_POOL_SHUTDOWN_0));
              }
          }
      }
docs: Terminate all threads in this thread group.<p>
  
  @param waitForJobsToComplete if true,, all current jobs will be allowed to complete