From fd3223b5cfc5db6498d4f010e65fcff0395ce00f Mon Sep 17 00:00:00 2001 From: Sameer Prakash Pradhan Date: Thu, 16 May 2019 15:29:57 +0530 Subject: [PATCH] [Non-ACR][contacts-service][thread safe issue for static var] Change-Id: Ib0e39550143751c113ebf590c8164f6aad664196 Signed-off-by: Sameer Prakash Pradhan --- common/ctsvc_view.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/ctsvc_view.c b/common/ctsvc_view.c index 14e4892..a491c8e 100644 --- a/common/ctsvc_view.c +++ b/common/ctsvc_view.c @@ -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 */ } -- 2.7.4