1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-10-31 23:26:22 +00:00

Fix potenctial data race condition

This commit is contained in:
Carles Fernandez 2023-12-02 13:01:08 +01:00
parent a152226f50
commit 15ddddf7c5
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 9 additions and 1 deletions

View File

@ -537,6 +537,13 @@ void gps_l1_ca_telemetry_decoder_gs::frame_synchronization(const Gnss_Synchro &c
} }
bool gps_l1_ca_telemetry_decoder_gs::is_PLL_180_deg_phase_locked()
{
gr::thread::scoped_lock lock(d_setlock);
return d_flag_PLL_180_deg_phase_locked;
}
int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
{ {
@ -613,7 +620,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
d_nav_msg_packet.nav_message = ""; d_nav_msg_packet.nav_message = "";
} }
if (d_flag_PLL_180_deg_phase_locked == true) if (is_PLL_180_deg_phase_locked())
{ {
// correct the accumulated phase for the Costas loop phase shift, if required // correct the accumulated phase for the Costas loop phase shift, if required
current_symbol.Carrier_phase_rads += GNSS_PI; current_symbol.Carrier_phase_rads += GNSS_PI;

View File

@ -75,6 +75,7 @@ private:
void check_tlm_separation(); void check_tlm_separation();
void frame_synchronization(const Gnss_Synchro &current_gs); void frame_synchronization(const Gnss_Synchro &current_gs);
bool is_PLL_180_deg_phase_locked();
bool gps_word_parityCheck(uint32_t gpsword); bool gps_word_parityCheck(uint32_t gpsword);
bool decode_subframe(double cn0, bool flag_invert); bool decode_subframe(double cn0, bool flag_invert);