From 50e1ed6cc6edfb2945c9bc4b1063c2337be2d0b4 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 17 Jul 2019 16:48:07 +0200 Subject: [PATCH] Change order of radio stop to avoid locking on rf_ms() by async thread --- lib/src/radio/radio_multi.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/radio/radio_multi.cc b/lib/src/radio/radio_multi.cc index 5549588ea..75676bb81 100644 --- a/lib/src/radio/radio_multi.cc +++ b/lib/src/radio/radio_multi.cc @@ -120,13 +120,13 @@ int radio_multi::init(const rf_args_t& args_, phy_interface_radio* phy_) void radio_multi::stop() { if (running) { - std::lock_guard lock(radio_instance_mutex); - instance = nullptr; - for (auto& radio : radios) { radio->stop(); } + std::lock_guard lock(radio_instance_mutex); + instance = nullptr; + running = false; } }