Change order of radio stop to avoid locking on rf_ms() by async thread

master
Ismael Gomez 6 years ago
parent 2574de4d2d
commit 50e1ed6cc6

@ -120,13 +120,13 @@ int radio_multi::init(const rf_args_t& args_, phy_interface_radio* phy_)
void radio_multi::stop() void radio_multi::stop()
{ {
if (running) { if (running) {
std::lock_guard<std::mutex> lock(radio_instance_mutex);
instance = nullptr;
for (auto& radio : radios) { for (auto& radio : radios) {
radio->stop(); radio->stop();
} }
std::lock_guard<std::mutex> lock(radio_instance_mutex);
instance = nullptr;
running = false; running = false;
} }
} }

Loading…
Cancel
Save