This commit has the following robust fixes for rshim over USB.
In rshim_fifo_output(), the actual Tx available size should be used instead of the maximum WRITE_BUF_SIZE, or else it could cause data loss on slow USB.
In rshim_notify(), use asynchronous rshim_work_signal() rather than direct function call to avoid race condition when rshim_notify() is called from USB completition callback.
In rshim_usb_fifo_read_callback(), use pthread_mutex_trylock() to avoid potential dead lock.
This commit has the following robust fixes for rshim over USB.
In rshim_fifo_output(), the actual Tx available size should be used instead of the maximum WRITE_BUF_SIZE, or else it could cause data loss on slow USB.
In rshim_notify(), use asynchronous rshim_work_signal() rather than direct function call to avoid race condition when rshim_notify() is called from USB completition callback.
In rshim_usb_fifo_read_callback(), use pthread_mutex_trylock() to avoid potential dead lock.