Destroy mutex and mutex Attribute in ProviderMemoryCache. 29/9729/4
authorjaesick.shin <jaesick.shin@samsung.com>
Tue, 26 Jul 2016 12:08:52 +0000 (21:08 +0900)
committerUze Choi <uzchoi@samsung.com>
Wed, 27 Jul 2016 05:26:12 +0000 (05:26 +0000)
Added Destroy logic about NSCacheMutex and NSCacheMutex Attribute.
Second patch remove the white space.

Change-Id: I68bdbce9bcb4addf3e910f2b4929318e5308cf5c
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9729
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/notification/src/provider/NSProviderInterface.c

index ae29be0..789eda3 100644 (file)
@@ -92,6 +92,15 @@ void NSSetList()
     NS_LOG(DEBUG, "NSSetList - OUT");\r
 }\r
 \r
+void NSDestroyList()\r
+{\r
+    NSStorageDestroy(consumerSubList);\r
+    NSStorageDestroy(messageList);\r
+\r
+    pthread_mutex_destroy(&NSCacheMutex);\r
+    pthread_mutexattr_destroy(&NSCacheMutexAttr);\r
+}\r
+\r
 NSResult NSStopProvider()\r
 {\r
     NS_LOG(DEBUG, "NSStopProvider - IN");\r
@@ -104,8 +113,7 @@ NSResult NSStopProvider()
         NSRegisterSubscribeRequestCb((NSSubscribeRequestCallback)NULL);\r
         NSRegisterSyncCb((NSProviderSyncInfoCallback)NULL);\r
         NSStopScheduler();\r
-        NSStorageDestroy(consumerSubList);\r
-        NSStorageDestroy(messageList);\r
+        NSDestroyList();\r
 \r
         initProvider = false;\r
     }\r