From efdec159644b52f3008995a284680364ad32edb6 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 1 Oct 2019 12:14:24 +0200 Subject: [PATCH] Renamed lock_guard (lg) to lock --- srsue/hdr/phy/sync.h | 12 ++++++------ srsue/src/phy/phy_common.cc | 1 - srsue/src/phy/sf_worker.cc | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/srsue/hdr/phy/sync.h b/srsue/hdr/phy/sync.h index e6b3d91c1..8e69416b8 100644 --- a/srsue/hdr/phy/sync.h +++ b/srsue/hdr/phy/sync.h @@ -221,7 +221,7 @@ private: */ state_t run_state() { - std::lock_guard lg(inside); + std::lock_guard lock(inside); cur_state = next_state; if (state_setting) { state_setting = false; @@ -234,7 +234,7 @@ private: // Called by the main thread at the end of each state to indicate it has finished. void state_exit(bool exit_ok = true) { - std::lock_guard lg(inside); + std::lock_guard lock(inside); if (cur_state == SFN_SYNC && exit_ok == true) { next_state = CAMPING; } else { @@ -245,7 +245,7 @@ private: } void force_sfn_sync() { - std::lock_guard lg(inside); + std::lock_guard lock(inside); next_state = SFN_SYNC; } @@ -256,19 +256,19 @@ private: */ void go_idle() { - std::lock_guard lg(outside); + std::lock_guard lock(outside); go_state(IDLE); } void run_cell_search() { - std::lock_guard lg(outside); + std::lock_guard lock(outside); go_state(CELL_SEARCH); wait_state_run(); wait_state_next(); } void run_sfn_sync() { - std::lock_guard lg(outside); + std::lock_guard lock(outside); go_state(SFN_SYNC); wait_state_run(); wait_state_next(); diff --git a/srsue/src/phy/phy_common.cc b/srsue/src/phy/phy_common.cc index 771c997af..9dc98cfcd 100644 --- a/srsue/src/phy/phy_common.cc +++ b/srsue/src/phy/phy_common.cc @@ -789,7 +789,6 @@ bool phy_common::is_mch_subframe(srslte_mbsfn_cfg_t* cfg, uint32_t phy_tti) uint32_t frame_alloc_idx = sfn % enum_to_number(mcch.common_sf_alloc_period); uint32_t sf_alloc_idx = frame_alloc_idx * mbsfn_per_frame + ((sf < 4) ? sf - 1 : sf - 3); std::unique_lock lock(mtch_mutex); - lock.lock(); while (!have_mtch_stop) { mtch_cvar.wait(lock); } diff --git a/srsue/src/phy/sf_worker.cc b/srsue/src/phy/sf_worker.cc index 60a6ec8e6..9d5739d93 100644 --- a/srsue/src/phy/sf_worker.cc +++ b/srsue/src/phy/sf_worker.cc @@ -80,7 +80,7 @@ sf_worker::~sf_worker() void sf_worker::reset() { - std::lock_guard lg(mutex); + std::lock_guard lock(mutex); rssi_read_cnt = 0; for (auto& cc_worker : cc_workers) { cc_worker->reset(); @@ -90,7 +90,7 @@ void sf_worker::reset() bool sf_worker::set_cell(uint32_t cc_idx, srslte_cell_t cell_) { bool ret = false; - std::lock_guard lg(mutex); + std::lock_guard lock(mutex); if (cc_idx < cc_workers.size()) { if (!cc_workers[cc_idx]->set_cell(cell_)) { @@ -173,7 +173,7 @@ void sf_worker::enable_pregen_signals(bool enabled) void sf_worker::set_config(uint32_t cc_idx, srslte::phy_cfg_t& phy_cfg) { - std::lock_guard lg(mutex); + std::lock_guard lock(mutex); if (cc_idx < cc_workers.size()) { Info("Setting configuration for cc_worker=%d, cc=%d\n", get_id(), cc_idx); cc_workers[cc_idx]->set_config(phy_cfg); @@ -184,7 +184,7 @@ void sf_worker::set_config(uint32_t cc_idx, srslte::phy_cfg_t& phy_cfg) void sf_worker::work_imp() { - std::lock_guard lg(mutex); + std::lock_guard lock(mutex); if (!cell_initiated) { return; }