public void setThreadPriority(int threadPriority) {
        if (!mState.compareAndSet(State.STOPPED, State.STOPPED)) {
            throw new IllegalStateException("threadPriority only configurable before SerialInputOutputManager is started");
        }
        mThreadPriority = threadPriority;
    }
setThreadPriority. By default a higher priority than UI thread is used to prevent data loss

@param threadPriority  see {@link Process#setThreadPriority(int)}
usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/util/SerialInputOutputManager.java