Fix data race in the enb::mac::ue metrics object.

This commit is contained in:
faluco 2021-10-01 13:49:14 +02:00 committed by Andre Puschmann
parent 83b9777220
commit a2c433b228
1 changed files with 5 additions and 2 deletions

View File

@ -108,7 +108,7 @@ uint8_t* cc_used_buffers_map::request_pdu(tti_point tti, uint32_t len)
void cc_used_buffers_map::clear_old_pdus(tti_point current_tti)
{
std::unique_lock<std::mutex> lock(mutex);
static const uint32_t old_tti_threshold = SRSRAN_FDD_NOF_HARQ + 4;
static const uint32_t old_tti_threshold = SRSRAN_FDD_NOF_HARQ + 4;
tti_point max_tti{current_tti - old_tti_threshold};
for (auto& pdu_pair : pdu_map) {
@ -205,7 +205,10 @@ ue::~ue() {}
void ue::reset()
{
ue_metrics = {};
{
std::lock_guard<std::mutex> lock(metrics_mutex);
ue_metrics = {};
}
nof_failures = 0;
for (auto& cc : cc_buffers) {