[Non-ACR][contacts-service][thread safe issue for static var] 24/206324/3 accepted/tizen/unified/20190520.084031 submit/tizen/20190517.053624
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Thu, 16 May 2019 09:59:57 +0000 (15:29 +0530)
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>
Thu, 16 May 2019 10:12:51 +0000 (10:12 +0000)
Change-Id: Ib0e39550143751c113ebf590c8164f6aad664196
Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
common/ctsvc_view.c

index 14e4892..a491c8e 100644 (file)
@@ -1344,7 +1344,7 @@ static const view_uri_info_s __tables[] = {
 static GHashTable *__ctsvc_view_uri_hash = NULL;
 
 #ifndef _CONTACTS_IPC_SERVER /* native or client library */
-static int __ctsvc_view_ref_count = 0;
+volatile static int __ctsvc_view_ref_count = 0;
 #endif
 
 void ctsvc_view_uri_init()
@@ -1379,7 +1379,7 @@ void ctsvc_view_uri_deinit()
 
        if (NULL == __ctsvc_view_uri_hash) {
                /* LCOV_EXCL_START */
-               ERR("contacts-service is not initialized");
+               ERR("deinit error: contacts-service is not initialized");
                return;
                /* LCOV_EXCL_STOP */
        }
@@ -1396,7 +1396,7 @@ ctsvc_record_type_e ctsvc_view_get_record_type(const char *view_uri)
 
        if (NULL == __ctsvc_view_uri_hash) {
                /* LCOV_EXCL_START */
-               ERR("contacts-service is not initialized");
+               ERR("get_record_type error: contacts-service is not initialized");
                return type;
                /* LCOV_EXCL_STOP */
        }
@@ -1414,7 +1414,7 @@ const char* ctsvc_view_get_uri(const char *view_uri)
 
        if (NULL == __ctsvc_view_uri_hash) {
                /* LCOV_EXCL_START */
-               ERR("contacts-service is not initialized");
+               ERR("get_uri error: contacts-service is not initialized");
                return NULL;
                /* LCOV_EXCL_STOP */
        }