stop() tore the sample thread down with stopWork() + delete and only then
cleared m_deviceShared.m_thread. The buddy's applySettings() suspends and
resumes that thread through m_thread from another thread, without holding
this device's mutex, so it could restart the thread between stopWork() and
delete (QThread: Destroyed while thread is still running -> qFatal/abort),
or call through the pointer after the delete. The device's own
applySettings() had the same exposure on its own thread pointer, since it
does not take m_mutex either.
Seen when the Satellite Tracker loads presets into the Rx and Tx device
sets of one Pluto at AOS: abort in PlutoSDRInputThread::~PlutoSDRInputThread
<- PlutoSDRInput::stop <- DSPDeviceSourceEngine::gotoIdle.
Add DevicePlutoSDRShared::m_threadsMutex (recursive, shared by all PlutoSDR
device sets) and take it in start() around startWork()/publish, in stop()
and handleError() around unpublish + teardown (unpublishing first), in
suspendBuddies()/resumeBuddies(), and for the whole suspend -> apply ->
resume sequence in applySettings(). Also wait() before deleting the thread
and check the own-thread pointer before resuming it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This folder contains classes and methods that can be used by different plugins that work with a common physical device or via network. Thus this can be one of the following devices:
BladeRF1: one Rx and one Tx full duplex. Plugins are:
bladerf1input
bladerf1output
BladeRF2: 2 Rx and 2 Tx full duplex (BladeRF 2.0 micro). Plugins are:
bladerf2input
bladerf2output
HackRF: one Rx and one Tx half duplex. Plugins are:
hackrfinput
hackrfoutput
LimeSDR: 2 Rx and 2 Tx full duplex (Lime-USB). 1 Rx and 1 Tx full duplex (Lime-Mini). Plugins are
limesdrinput
limesdroutput
PlutoSDR: one Rx and one Tx full duplex. Plugins are
plutosdrinput
plutosdroutput
SoapySDR: Soapy SDR virtual device
soapysdrinput
soapysdroutput
USRP: Up to 2 Rx and 2 Tx full duplex. Plugins are