private boolean isStillRunning() {
        State state = mState.get();
        return ((state == State.RUNNING) || (state == State.STARTING))
            && !Thread.currentThread().isInterrupted();
    }
@return true if the thread is still running
usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/util/SerialInputOutputManager.java