Closed johanhedin closed 3 years ago
Thanks for your contribution It seems to be the best compromise with minimal impact on code
Could you share you results ? (does it fix fully the issue on your side)
Could you share you results ? (does it fix fully the issue on your side)
Running the test program I attached in #74 against master will deadlock 10 out of 10 times when pulling the device. Running the same program against this branch of libairspy never show the deadlock.
Always difficult with threads and synchronization, but I would say that this patch fully fix the deadlock issue that I have seen.
Replace device->streaming = false with device->stop_requested = true for USB errors to avoid deadlock on device removal. Also check stop_requested when checking if streaming or not to be consistent with the old behavior.
This is another take on issue #74 instead of pull request #75.