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

master
faluco 3 years ago committed by Andre Puschmann
parent 83b9777220
commit a2c433b228

@ -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) void cc_used_buffers_map::clear_old_pdus(tti_point current_tti)
{ {
std::unique_lock<std::mutex> lock(mutex); 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}; tti_point max_tti{current_tti - old_tti_threshold};
for (auto& pdu_pair : pdu_map) { for (auto& pdu_pair : pdu_map) {
@ -205,7 +205,10 @@ ue::~ue() {}
void ue::reset() void ue::reset()
{ {
ue_metrics = {}; {
std::lock_guard<std::mutex> lock(metrics_mutex);
ue_metrics = {};
}
nof_failures = 0; nof_failures = 0;
for (auto& cc : cc_buffers) { for (auto& cc : cc_buffers) {

Loading…
Cancel
Save