diff options
author | Steve Markgraf <steve@steve-m.de> | 2019-08-25 17:34:20 +0200 |
---|---|---|
committer | Steve Markgraf <steve@steve-m.de> | 2019-08-25 17:34:20 +0200 |
commit | b8d33bfd820953982093b7a7db154a58d7f7bd9e (patch) | |
tree | 754373ee9fbb5c1d67fdc698f730d43494d50c76 | |
parent | 6c21e9d01f8169643de76a0342a1f49a52212cfc (diff) | |
download | osmo-fl2k-b8d33bfd820953982093b7a7db154a58d7f7bd9e.tar.gz osmo-fl2k-b8d33bfd820953982093b7a7db154a58d7f7bd9e.tar.bz2 osmo-fl2k-b8d33bfd820953982093b7a7db154a58d7f7bd9e.zip |
lib: wait for sample worker thread before freeing buffers
This fixes a segfault when exiting, as sometimes it occured that
the USB worker thread completed before the sample worker thread,
and the buffers the latter was still accessing had already been
freed.
-rw-r--r-- | src/libosmo-fl2k.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libosmo-fl2k.c b/src/libosmo-fl2k.c index 7748238..0b03254 100644 --- a/src/libosmo-fl2k.c +++ b/src/libosmo-fl2k.c @@ -777,6 +777,8 @@ static void *fl2k_usb_worker(void *arg) } } + /* wait for sample worker thread to finish before freeing buffers */ + pthread_join(dev->sample_worker_thread, NULL); _fl2k_free_async_buffers(dev); dev->async_status = next_status; |