From cfbda81cb3112347cd5f91e76c90c82e53f9fcd6 Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Wed, 6 Sep 2017 04:17:16 -0700 Subject: [PATCH] Add lock for get response --- syncd/syncd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syncd/syncd.cpp b/syncd/syncd.cpp index 39899d76f47c..aec117689c01 100644 --- a/syncd/syncd.cpp +++ b/syncd/syncd.cpp @@ -588,6 +588,9 @@ void internal_syncd_get_send( // since we have only one get at a time, we don't have to serialize // object type and object id, only get status is required // get response will not put any data to table only queue is used + + std::lock_guard lock(g_db_mutex); + getResponse->set(key, entry, "getresponse"); SWSS_LOG_INFO("response for GET api was send"); @@ -981,6 +984,8 @@ void sendResponse(sai_status_t status) SWSS_LOG_NOTICE("sending response: %s", str_status.c_str()); + std::lock_guard lock(g_db_mutex); + getResponse->set(str_status, entry, "notify"); }