From: Sameer Prakash Pradhan Date: Thu, 16 May 2019 09:59:57 +0000 (+0530) Subject: [Non-ACR][contacts-service][thread safe issue for static var] X-Git-Tag: accepted/tizen/unified/20190520.084031^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F206324%2F3;p=platform%2Fcore%2Fpim%2Fcontacts-service.git [Non-ACR][contacts-service][thread safe issue for static var] Change-Id: Ib0e39550143751c113ebf590c8164f6aad664196 Signed-off-by: Sameer Prakash Pradhan --- 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 */ }