From 25127a0b273ac96f7381fe2256724cc88cccbf41 Mon Sep 17 00:00:00 2001
From: Antonio Ramos <antonio.ramosdet@gmail.com>
Date: Wed, 10 Jan 2018 16:24:09 +0100
Subject: [PATCH] Minor changes

---
 .../tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc   | 2 ++
 src/core/receiver/gnss_flowgraph.cc                             | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
index ec5004c56..8911db3db 100644
--- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
+++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_cc.cc
@@ -185,6 +185,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
 
 void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
 {
+    gr::thread::scoped_lock lk(d_setlock);
     /*
      *  correct the code phase according to the delay between acq and trk
      */
@@ -521,6 +522,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::~Gps_L1_Ca_Dll_Pll_Tracking_cc()
 int Gps_L1_Ca_Dll_Pll_Tracking_cc::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::thread::scoped_lock lk(d_setlock);
     // process vars
     double carr_error_hz = 0.0;
     double carr_error_filt_hz = 0.0;
diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc
index cf1226102..a59d4e5d1 100644
--- a/src/core/receiver/gnss_flowgraph.cc
+++ b/src/core/receiver/gnss_flowgraph.cc
@@ -382,6 +382,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
                         channels_state_[i] = 1;
                         channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true));
                         acq_channels_count_++;
+                        DLOG(INFO) << "Channel "<< i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str();
                         channels_.at(i)->start_acquisition();
                     }
                 DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];