Assign descriptive names to SDRangel threads so thread activity can be
identified when investigating multi-threaded behavior, including crashes,
leaks, and synchronization issues in debuggers and others tools.
Use compact names to fit platform thread-name limits (14 chars) while
retaining the component and thread role where possible.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Detect negative return values from rxBufferRefill() and txBufferPush() in
the PlutoSDR input, output, and MIMO worker threads. These calls can fail
asynchronously after the device has successfully started, for example
when the PlutoSDR is disconnected or the underlying I/O connection
encounters an error.
Log the underlying error and emit the error code from the affected worker
thread instead of treating the negative return value as an ordinary
short or incomplete buffer.
This allows asynchronous PlutoSDR acquisition and generation failures to
be propagated out of the worker threads and handled by the device and DSP
error-handling infrastructure, rather than allowing the streaming thread
to continue operating with an invalid device state.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
AddressSanitizer (ASAN) reports a memory leak from the buffer conversion
memory allocated by PlutoSDRInputThread. The memory was not released when
the thread was destroyed, causing the allocation to persist after the
device was closed.
Delete the conversion buffer in the thread destructor so the allocation is
properly released and the leak reported by ASAN is eliminated.
Signed-off-by: Robin Getz <rgetz503@gmail.com>