docs: private void setState(IState toState)
      {
          // We want to make sure state changes happen purely on the "home" thread,
          // for the sake of sanity and avoiding many obscure race-condition bugs.
          if (Thread.currentThread() == this.homeThread)
          {
              // We are on the home thread, so safe to proceed:
              if (this.state != toState)
              {
                  System.out.println(getName() + " enter state: " + toState);
                  TCPUtils.Log(Level.INFO, "======== " + getName() + " enter state: " + toState + " ========");
                  this.state = toState;
                  onPreStateChange(toState);
                  onStateChange();
              }
          }
          else
          {
              // We are not on the home thread; queue this state transition
              // so that the home thread can act on it.
              queueStateChange(toState);
          }
      }