From 388b1e5d9246d4cc24b8537fabf2017269b29ffc Mon Sep 17 00:00:00 2001 From: faluco Date: Mon, 4 Oct 2021 12:01:19 +0200 Subject: [PATCH] Fix data race in radio::is_start_of_burst. --- lib/include/srsran/radio/radio.h | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/include/srsran/radio/radio.h b/lib/include/srsran/radio/radio.h index 0c206f1d6..ca1e7bcab 100644 --- a/lib/include/srsran/radio/radio.h +++ b/lib/include/srsran/radio/radio.h @@ -91,9 +91,9 @@ private: std::vector rx_offset_n = {}; rf_metrics_t rf_metrics = {}; std::mutex metrics_mutex; - srslog::basic_logger& logger = srslog::fetch_basic_logger("RF", false); - phy_interface_radio* phy = nullptr; - cf_t* zeros = nullptr; + srslog::basic_logger& logger = srslog::fetch_basic_logger("RF", false); + phy_interface_radio* phy = nullptr; + cf_t* zeros = nullptr; std::array dummy_buffers; std::mutex tx_mutex; std::mutex rx_mutex; @@ -103,23 +103,23 @@ private: std::array decimators = {}; bool decimator_busy = false; ///< Indicates the decimator is changing the rate - rf_timestamp_t end_of_burst_time = {}; - bool is_start_of_burst = false; - uint32_t tx_adv_nsamples = 0; - double tx_adv_sec = 0.0; // Transmission time advance to compensate for antenna->timestamp delay - bool tx_adv_auto = false; - bool tx_adv_negative = false; - bool is_initialized = false; - bool radio_is_streaming = false; - bool continuous_tx = false; - double freq_offset = 0.0; - double cur_tx_srate = 0.0; - double cur_rx_srate = 0.0; - double fix_srate_hz = 0.0; - uint32_t nof_antennas = 0; - uint32_t nof_channels = 0; - uint32_t nof_channels_x_dev = 0; - uint32_t nof_carriers = 0; + rf_timestamp_t end_of_burst_time = {}; + std::atomic is_start_of_burst{false}; + uint32_t tx_adv_nsamples = 0; + double tx_adv_sec = 0.0; // Transmission time advance to compensate for antenna->timestamp delay + bool tx_adv_auto = false; + bool tx_adv_negative = false; + bool is_initialized = false; + bool radio_is_streaming = false; + bool continuous_tx = false; + double freq_offset = 0.0; + double cur_tx_srate = 0.0; + double cur_rx_srate = 0.0; + double fix_srate_hz = 0.0; + uint32_t nof_antennas = 0; + uint32_t nof_channels = 0; + uint32_t nof_channels_x_dev = 0; + uint32_t nof_carriers = 0; std::vector cur_tx_freqs = {}; std::vector cur_rx_freqs = {};