diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 7bbad25dd..60552f613 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -409,8 +409,11 @@ void phy::set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rn void phy::set_crnti(uint16_t rnti) { + // set_crnti() is an operation that takes time, apply asynrhonously with processing for (uint32_t i = 0; i < nof_workers; i++) { - workers[i]->set_crnti(rnti); + sf_worker* w = (sf_worker*)workers_pool.wait_worker_id(i); + w->set_crnti(rnti); + w->release(); } } @@ -439,8 +442,12 @@ void phy::set_config(srslte::phy_cfg_t& config_, uint32_t cc_idx, uint32_t earfc // Send configuration to workers for (uint32_t i = 0; i < nof_workers; i++) { if (cell_info) { - workers[i]->set_cell(cc_idx, *cell_info); + // set_cell() is an operation that takes time, apply asynrhonously with processing + sf_worker* w = (sf_worker*)workers_pool.wait_worker_id(i); + w->set_cell(cc_idx, *cell_info); + w->release(); } + // set_config() is just a memcpy workers[i]->set_config(cc_idx, config_); } diff --git a/srsue/src/phy/sync.cc b/srsue/src/phy/sync.cc index 95a02dae7..6073b6f82 100644 --- a/srsue/src/phy/sync.cc +++ b/srsue/src/phy/sync.cc @@ -765,11 +765,15 @@ bool sync::set_cell() sfn_p.set_cell(cell); worker_com->set_cell(cell); + bool success = true; for (uint32_t i = 0; i < workers_pool->get_nof_workers(); i++) { - if (!((sf_worker*)workers_pool->get_worker(i))->set_cell(0, cell)) { - Error("SYNC: Setting cell: initiating PHCH worker\n"); - return false; - } + sf_worker* w = (sf_worker*)workers_pool->wait_worker_id(i); + success &= w->set_cell(0, cell); + w->release(); + } + if (!success) { + Error("SYNC: Setting cell: initiating PHCH worker\n"); + return false; } // Set options defined in expert section