Closed jhindin closed 9 years ago
I have merged this, but having looked at the changes I am not convinced that it works. If there are no midi events queued, then surely the driver loop will exit and shut down.
In the case when midi events are left in the queue upon stop, the code contains race condition: the events left in the queue after the consumer thread stop, would be send when the driver restarts.
The event queue has to be drained or emptied on stop. The solution presented in the patch drains the queue; potentially, if application stops the midi driver but continues sending the events, the consumer thread would not stop, but such code is problematic anyway.
Regards,
Joseph Hindin
Android studio files changed, code formatting, running while queue is not empty