docs: private synchronized void cleanupThread ( long timeout ) throws TransportException {
          Thread t = this.thread;
          if ( t != null && Thread.currentThread() != t ) {
              this.thread = null;
              try {
                  log.debug("Interrupting transport thread");
                  t.interrupt();
                  log.debug("Joining transport thread");
                  t.join(timeout);
                  log.debug("Joined transport thread");
              }
              catch ( InterruptedException e ) {
                  throw new TransportException("Failed to join transport thread", e);
              }
          }
          else if ( t != null ) {
              this.thread = null;
          }
      }