From: wn.jang Date: Thu, 26 Dec 2019 05:58:36 +0000 (+0900) Subject: Remove unnecessary mutex to avoid race condition X-Git-Tag: accepted/tizen/unified/20200211.132125~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6d1397aae9f70716b90736f9f80fdcdb58f8d35;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Remove unnecessary mutex to avoid race condition Change-Id: I7613e04283bd9a4fae40b96130a9e5b8a520a76b (cherry picked from commit a4993d8f5fa24d130de788ef5cb4ee3ccc67db9a) --- diff --git a/common/vc_config_mgr.c b/common/vc_config_mgr.c index 8dda6b7..76a3bca 100644 --- a/common/vc_config_mgr.c +++ b/common/vc_config_mgr.c @@ -1872,26 +1872,21 @@ bool vc_config_check_default_engine_is_valid(const char* engine) bool vc_config_check_default_language_is_valid(const char* language) { - pthread_mutex_lock(&vc_config_mgr_mutex); if (0 >= g_slist_length(g_config_client_list)) { SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Not initialized"); - pthread_mutex_unlock(&vc_config_mgr_mutex); return -1; } if (NULL == language) { - pthread_mutex_unlock(&vc_config_mgr_mutex); return false; } if (NULL == g_config_info->engine_id) { SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Default engine id is NULL"); - pthread_mutex_unlock(&vc_config_mgr_mutex); return false; } if (0 >= g_slist_length(g_engine_list)) { - pthread_mutex_unlock(&vc_config_mgr_mutex); return false; } @@ -1925,7 +1920,7 @@ bool vc_config_check_default_language_is_valid(const char* language) lang = iter_lang->data; if (0 == strcmp(language, lang)) { - pthread_mutex_unlock(&vc_config_mgr_mutex); + SLOG(LOG_INFO, vc_config_tag(), "[INFO] Default language(%s) is valid", language); return true; } @@ -1935,7 +1930,6 @@ bool vc_config_check_default_language_is_valid(const char* language) break; } - pthread_mutex_unlock(&vc_config_mgr_mutex); return false; }