hdctools: ftdiuart: Yield between pthread locks.

Inserting 1 usec sleep after pthread lock is released to give other
threads a better chance to grab the lock.

Prior to adding the usleep(1), obtaining the lock took anywhere from
instantaneous to 10's of seconds.  After inserting the sleep I see a
worstcase lock -> work -> release of another thread of 300ms.

BUG=chrome-os-partner:9566
TEST=manual
    sudo servod
    cu -l `dut-control ec_uart_pty`
    dut-control -r 100 ec_uart_baudrate:115200 | grep ^@@
    <While dut-control is resetting baudrate, pound on keyboard of device
      connected to ec_uart_pty and see expected console activity>

Change-Id: Ie7cf8d4e90a4a463dd91de00a6c7353402b37c89
Reviewed-on: https://gerrit.chromium.org/gerrit/22768
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Todd Broch <tbroch@chromium.org>
1 file changed