From: jaesick.shin Date: Tue, 9 Aug 2016 12:37:07 +0000 (+0900) Subject: Modify related topiclist. X-Git-Tag: 1.2.0+RC1~52^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24dc8074e3b488b27363ee7a1b952003dcf523d7;p=platform%2Fupstream%2Fiotivity.git Modify related topiclist. first patch included 1. Rename function and variables related TopicList. 2. Destory TopicList. second patch inlcuded remove the white spaces. third pacth included remove duplicated initTopiList. four patch updated commit message only. Change-Id: Id13c4442546c0659eb4f8c73a4f2a7fc832d330e Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/10205 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- diff --git a/service/notification/src/provider/NSProviderInterface.c b/service/notification/src/provider/NSProviderInterface.c index 0c81b2d..3a54b11 100644 --- a/service/notification/src/provider/NSProviderInterface.c +++ b/service/notification/src/provider/NSProviderInterface.c @@ -89,6 +89,7 @@ void NSSetList() NSInitSubscriptionList(); NSInitMessageList(); + NSInitTopicList(); NS_LOG(DEBUG, "NSSetList - OUT"); } @@ -96,6 +97,7 @@ void NSDestroyList() { NSStorageDestroy(consumerSubList); NSStorageDestroy(messageList); + NSStorageDestroy(consumerTopicList); pthread_mutex_destroy(&NSCacheMutex); pthread_mutexattr_destroy(&NSCacheMutexAttr); @@ -261,9 +263,7 @@ NSResult NSProviderRegisterTopics(NSTopicList *topicList) NS_LOG(DEBUG, "NSProviderSetTopics - IN"); pthread_mutex_lock(&nsInitMutex); - NSInitTopicStorage(); - - NSPushQueue(TOPIC_SCHEDULER, TASK_REGISTER_TOPICS, topicList); + NSPushQueue(TOPIC_SCHEDULER, TASK_REGISTER_TOPICS, consumerTopicList); pthread_mutex_unlock(&nsInitMutex); NS_LOG(DEBUG, "NSProviderSetTopics - OUT"); diff --git a/service/notification/src/provider/NSProviderTopic.c b/service/notification/src/provider/NSProviderTopic.c index c683240..44c5b65 100644 --- a/service/notification/src/provider/NSProviderTopic.c +++ b/service/notification/src/provider/NSProviderTopic.c @@ -22,7 +22,7 @@ static bool isTopicList = false; -NSResult NSInitTopicStorage() +NSResult NSInitTopicList() { NS_LOG(DEBUG, "NSInitTopicList - IN"); @@ -32,8 +32,8 @@ NSResult NSInitTopicStorage() return NS_FAIL; } - topicStorage = NSStorageCreate(); - topicStorage->cacheType = NS_PROVIDER_CACHE_TOPIC; + consumerTopicList = NSStorageCreate(); + consumerTopicList->cacheType = NS_PROVIDER_CACHE_TOPIC; isTopicList = true; NS_LOG(DEBUG, "NSInitTopicList - OUT"); @@ -77,7 +77,7 @@ NSResult NSStoreTopics(char * consumerId, NSTopic** topics) element->data = (void*) topicData; element->next = NULL; - if(NSStorageWrite(topicStorage, element) != NS_OK) + if(NSStorageWrite(consumerTopicList, element) != NS_OK) { NS_LOG(DEBUG, "fail to write cache"); } diff --git a/service/notification/src/provider/NSProviderTopic.h b/service/notification/src/provider/NSProviderTopic.h index 0f9b6b1..5f65e74 100644 --- a/service/notification/src/provider/NSProviderTopic.h +++ b/service/notification/src/provider/NSProviderTopic.h @@ -28,9 +28,9 @@ #include "NSProviderResource.h" #include "NSProviderSubscription.h" -NSCacheList * topicStorage; +NSCacheList * consumerTopicList; -NSResult NSInitTopicStorage(); +NSResult NSInitTopicList(); NSTopicList * NSGetTopics(char *consumerId); bool NSIsTopicSubscribed(char *consumerId, char *topic);