#vulnerable code 
                              public void shutdown() throws InterruptedException {
    stopRebalancingTimer();
    while (_eventThread.isAlive()) {
      _eventThread.interrupt();
      _eventThread.join(EVENT_THREAD_JOIN_TIMEOUT);
    }
    _asyncTasksThreadPool.shutdown();
  } 
                            #location 2 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                              public void shutdown() throws InterruptedException {
    stopRebalancingTimer();

    terminateEventThread(_eventThread);
    terminateEventThread(_taskEventThread);

    _asyncTasksThreadPool.shutdown();
  }