use lock_guard for GW

This commit is contained in:
Andre Puschmann 2019-06-10 12:04:26 +02:00
parent 89416a67c7
commit b32254c5e2
2 changed files with 3 additions and 5 deletions

View File

@ -47,7 +47,6 @@ add_executable(rlc_um_test rlc_um_test.cc)
target_link_libraries(rlc_um_test srslte_upper srslte_phy rrc_asn1)
add_test(rlc_um_test rlc_um_test)
########################################################################
# Option to run command after build (useful for remote builds)
########################################################################

View File

@ -352,10 +352,10 @@ void gw::run_thread()
gw_log->info("GW IP receiver thread exiting.\n");
}
uint8_t gw::check_tft_filter_match(const srslte::unique_byte_buffer_t& pdu) {
uint8_t gw::check_tft_filter_match(const srslte::unique_byte_buffer_t& pdu)
{
std::lock_guard<std::mutex> lock(tft_mutex);
uint8_t lcid = default_lcid;
tft_mutex.lock();
for (std::pair<const uint16_t, tft_packet_filter_t>& filter_pair : tft_filter_map) {
bool match = filter_pair.second.match(pdu);
if (match) {
@ -364,7 +364,6 @@ uint8_t gw::check_tft_filter_match(const srslte::unique_byte_buffer_t& pdu) {
break;
}
}
tft_mutex.unlock();
return lcid;
}