diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-03-31 21:57:59 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-03-31 21:57:59 +0200 |
commit | 12374d9c368a582459a6211e2d48046bc43f5fbb (patch) | |
tree | 41779d276ac98dad46ffbbd7018388ed5aff6bc6 | |
parent | 749dc8dd8f8d5659bd967e2b84bd868344bc6037 (diff) | |
download | dabmod-12374d9c368a582459a6211e2d48046bc43f5fbb.tar.gz dabmod-12374d9c368a582459a6211e2d48046bc43f5fbb.tar.bz2 dabmod-12374d9c368a582459a6211e2d48046bc43f5fbb.zip |
Fix race condition on SDR thread creation
-rw-r--r-- | src/output/SDR.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 75a7ee3..17668e3 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2023 + Copyright (C) 2024 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -66,6 +66,7 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr<SDRDevice> device) : // muting is remote-controllable m_config.muting = false; + m_running.store(true); m_device_thread = std::thread(&SDR::process_thread_entry, this); if (m_config.dpdFeedbackServerPort > 0) { @@ -210,8 +211,6 @@ void SDR::process_thread_entry() last_tx_time_initialised = false; - m_running.store(true); - try { while (m_running.load()) { struct FrameData frame; |