From 12374d9c368a582459a6211e2d48046bc43f5fbb Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 31 Mar 2024 21:57:59 +0200 Subject: Fix race condition on SDR thread creation --- src/output/SDR.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/output/SDR.cpp') 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 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; -- cgit v1.2.3