1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50:34 +00:00

Fix potenctial data race condition

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

View File

@ -212,6 +212,13 @@ gr::basic_block_sptr Channel::get_right_block()
} }
Gnss_Signal Channel::get_signal()
{
std::lock_guard<std::mutex> lk(mx_);
return gnss_signal_;
}
void Channel::set_signal(const Gnss_Signal& gnss_signal) void Channel::set_signal(const Gnss_Signal& gnss_signal)
{ {
std::lock_guard<std::mutex> lk(mx_); std::lock_guard<std::mutex> lk(mx_);

View File

@ -84,7 +84,7 @@ public:
inline std::string role() override { return role_; } inline std::string role() override { return role_; }
inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel" inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel"
inline size_t item_size() override { return 2 * sizeof(float); } inline size_t item_size() override { return 2 * sizeof(float); }
inline Gnss_Signal get_signal() const override { return gnss_signal_; } Gnss_Signal get_signal() override;
void start_acquisition() override; //!< Start the State Machine void start_acquisition() override; //!< Start the State Machine
void stop_channel() override; //!< Stop the State Machine void stop_channel() override; //!< Stop the State Machine
void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal

View File

@ -49,7 +49,7 @@ public:
virtual gr::basic_block_sptr get_right_block_acq() = 0; virtual gr::basic_block_sptr get_right_block_acq() = 0;
virtual gr::basic_block_sptr get_left_block() = 0; virtual gr::basic_block_sptr get_left_block() = 0;
virtual gr::basic_block_sptr get_right_block() = 0; virtual gr::basic_block_sptr get_right_block() = 0;
virtual Gnss_Signal get_signal() const = 0; virtual Gnss_Signal get_signal() = 0;
virtual void start_acquisition() = 0; virtual void start_acquisition() = 0;
virtual void assist_acquisition_doppler(double Carrier_Doppler_hz) = 0; virtual void assist_acquisition_doppler(double Carrier_Doppler_hz) = 0;
virtual void stop_channel() = 0; virtual void stop_channel() = 0;