From f28ed4f45f2b0adacd7c2b0cebcacdad8caafb88 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 27 Nov 2023 15:28:02 +0100 Subject: [PATCH] Fix data race condition detected by Coverity Scan --- src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index 4ac0fd221..5aa106bf3 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -871,6 +871,7 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) // Called by gnuradio to enable drivers, etc for i/o devices. bool pcps_acquisition::start() { + gr::thread::scoped_lock lk(d_setlock); d_sample_counter = 0ULL; calculate_threshold(); return true; @@ -1017,7 +1018,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)), { Gnss_Synchro current_synchro_data = d_monitor_queue.front(); d_monitor_queue.pop(); - *out[i] = current_synchro_data; + *out[i] = std::move(current_synchro_data); } return num_gnss_synchro_objects; }