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

This commit is contained in:
Ismael Gomez 2019-07-17 16:48:07 +02:00
parent 2574de4d2d
commit 50e1ed6cc6
1 changed files with 3 additions and 3 deletions

View File

@ -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;
} }
} }