Fix data race condition detected by Coverity Scan

This commit is contained in:
Carles Fernandez 2023-11-27 15:47:59 +01:00
parent f28ed4f45f
commit 15c6108fe4
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 3 additions and 0 deletions

View File

@ -918,6 +918,7 @@ int galileo_telemetry_decoder_gs::general_work(int noutput_items __attribute__((
// check if there is a problem with the telemetry of the current satellite
if (d_sent_tlm_failed_msg == false)
{
gr::thread::scoped_lock lock(d_setlock);
if ((d_symbol_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame)
{
const int message = 1; // bad telemetry

View File

@ -464,6 +464,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
// check if there is a problem with the telemetry of the current satellite
if (d_stat < 2 && d_sent_tlm_failed_msg == false)
{
gr::thread::scoped_lock lock(d_setlock);
if ((d_sample_counter - d_last_valid_preamble) > d_max_symbols_without_valid_frame)
{
const int message = 1; // bad telemetry
@ -551,6 +552,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
if (d_CRC_error_counter > 2)
{
DLOG(INFO) << "Lost of frame sync SAT " << this->d_satellite;
gr::thread::scoped_lock lock(d_setlock);
d_flag_frame_sync = false;
d_stat = 0;
d_TOW_at_current_symbol_ms = 0;