Commit 63c7aca6 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

bug fix for mutex after mege

parent 9c047060
...@@ -55,7 +55,7 @@ AlwaysBreakAfterReturnType: None ...@@ -55,7 +55,7 @@ AlwaysBreakAfterReturnType: None
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
# template style # template style
AlwaysBreakTemplateDeclarations: Yes #AlwaysBreakTemplateDeclarations: Yes
# preprocessor style # preprocessor style
IndentPPDirectives: None IndentPPDirectives: None
...@@ -79,9 +79,9 @@ UseTab: Never ...@@ -79,9 +79,9 @@ UseTab: Never
SpaceAfterCStyleCast: true SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeInheritanceColon: true #SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true #SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2 SpacesBeforeTrailingComments: 2
SpacesInAngles: false SpacesInAngles: false
...@@ -92,7 +92,7 @@ SpacesInSquareBrackets: false ...@@ -92,7 +92,7 @@ SpacesInSquareBrackets: false
# class style # class style
BreakConstructorInitializers: BeforeColon BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon #BreakInheritanceList: BeforeColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4 ConstructorInitializerIndentWidth: 4
...@@ -115,3 +115,4 @@ SortUsingDeclarations: true ...@@ -115,3 +115,4 @@ SortUsingDeclarations: true
# PenaltyBreakTemplateDeclaration (unsigned) # PenaltyBreakTemplateDeclaration (unsigned)
# PenaltyExcessCharacter (unsigned) # PenaltyExcessCharacter (unsigned)
# PenaltyReturnTypeOnItsOwnLine (unsigned) # PenaltyReturnTypeOnItsOwnLine (unsigned)
...@@ -480,7 +480,6 @@ void smf_pdu_session::update_qos_rule(const QOSRulesIE &qos_rule) { ...@@ -480,7 +480,6 @@ void smf_pdu_session::update_qos_rule(const QOSRulesIE &qos_rule) {
uint8_t rule_id = qos_rule.qosruleidentifer; uint8_t rule_id = qos_rule.qosruleidentifer;
if ((rule_id >= QOS_RULE_IDENTIFIER_FIRST ) if ((rule_id >= QOS_RULE_IDENTIFIER_FIRST )
and (rule_id <= QOS_RULE_IDENTIFIER_LAST )) { and (rule_id <= QOS_RULE_IDENTIFIER_LAST )) {
std::unique_lock lock(m_pdu_session_mutex);
if (qos_rules.count(rule_id) > 0) { if (qos_rules.count(rule_id) > 0) {
lock.lock(); // Lock it here lock.lock(); // Lock it here
qos_rules.erase(rule_id); qos_rules.erase(rule_id);
...@@ -504,7 +503,6 @@ void smf_pdu_session::mark_qos_rule_to_be_synchronised(const uint8_t rule_id) { ...@@ -504,7 +503,6 @@ void smf_pdu_session::mark_qos_rule_to_be_synchronised(const uint8_t rule_id) {
std::unique_lock lock(m_pdu_session_mutex, std::defer_lock); // Do not lock it first std::unique_lock lock(m_pdu_session_mutex, std::defer_lock); // Do not lock it first
if ((rule_id >= QOS_RULE_IDENTIFIER_FIRST ) if ((rule_id >= QOS_RULE_IDENTIFIER_FIRST )
and (rule_id <= QOS_RULE_IDENTIFIER_LAST )) { and (rule_id <= QOS_RULE_IDENTIFIER_LAST )) {
std::unique_lock lock(m_pdu_session_mutex);
if (qos_rules.count(rule_id) > 0) { if (qos_rules.count(rule_id) > 0) {
lock.lock(); // Lock it here lock.lock(); // Lock it here
qos_rules_to_be_synchronised.push_back(rule_id); qos_rules_to_be_synchronised.push_back(rule_id);
...@@ -533,7 +531,6 @@ void smf_pdu_session::add_qos_rule(const QOSRulesIE &qos_rule) { ...@@ -533,7 +531,6 @@ void smf_pdu_session::add_qos_rule(const QOSRulesIE &qos_rule) {
if ((rule_id >= QOS_RULE_IDENTIFIER_FIRST ) if ((rule_id >= QOS_RULE_IDENTIFIER_FIRST )
and (rule_id <= QOS_RULE_IDENTIFIER_LAST )) { and (rule_id <= QOS_RULE_IDENTIFIER_LAST )) {
std::unique_lock lock(m_pdu_session_mutex);
if (qos_rules.count(rule_id) > 0) { if (qos_rules.count(rule_id) > 0) {
Logger::smf_app().error("Failed to add rule (Id %d), rule existed", Logger::smf_app().error("Failed to add rule (Id %d), rule existed",
rule_id); rule_id);
......
...@@ -434,7 +434,7 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> { ...@@ -434,7 +434,7 @@ class smf_pdu_session : public std::enable_shared_from_this<smf_pdu_session> {
uint8_t number_of_supported_packet_filters; //number_of_supported_packet_filters uint8_t number_of_supported_packet_filters; //number_of_supported_packet_filters
util::uint_generator<uint32_t> qos_rule_id_generator; util::uint_generator<uint32_t> qos_rule_id_generator;
// Recursive lock // Shared lock
mutable std::shared_mutex m_pdu_session_mutex; mutable std::shared_mutex m_pdu_session_mutex;
}; };
...@@ -479,7 +479,7 @@ class session_management_subscription { ...@@ -479,7 +479,7 @@ class session_management_subscription {
snssai_t single_nssai; snssai_t single_nssai;
std::map<std::string, std::shared_ptr<dnn_configuration_t>> dnn_configurations; //dnn <->dnn_configuration std::map<std::string, std::shared_ptr<dnn_configuration_t>> dnn_configurations; //dnn <->dnn_configuration
// Recursive lock // Shared lock
mutable std::shared_mutex m_mutex; mutable std::shared_mutex m_mutex;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment