lib: fix hang on exit

As the sample worker thread might still be waiting for a buffer,
we need to wake it up first before trying to join.
This commit is contained in:
Steve Markgraf 2020-05-26 23:10:37 +02:00
parent 44b6e3b929
commit b11fc430f3
1 changed files with 3 additions and 0 deletions

View File

@ -794,6 +794,9 @@ static void *fl2k_usb_worker(void *arg)
}
}
/* wake up sample worker */
pthread_cond_signal(&dev->buf_cond);
/* wait for sample worker thread to finish before freeing buffers */
pthread_join(dev->sample_worker_thread, NULL);
_fl2k_free_async_buffers(dev);