From: jk13 Date: Mon, 17 Nov 2014 11:09:02 +0000 (+0900) Subject: [SSM] Remove global mutex X-Git-Tag: 0.9.0-CA-RC1~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9d162aa802feaf00586bf8f357deb4a3272b016;p=contrib%2Fiotivity.git [SSM] Remove global mutex Problem: global mutex is not necessary while initializing platform. How: Remove global mutex class and references. Change-Id: I8972c6eb7d67dbd91c5c8638bec22fe83f83ef43 Signed-off-by: Kim Jee Hyeok --- diff --git a/service/soft-sensor-manager/SSMCore/src/Common/CAGlobalMutex.h b/service/soft-sensor-manager/SSMCore/src/Common/CAGlobalMutex.h deleted file mode 100644 index 09aef40..0000000 --- a/service/soft-sensor-manager/SSMCore/src/Common/CAGlobalMutex.h +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************** -* -* Copyright 2014 Samsung Electronics All Rights Reserved. -* -* -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -******************************************************************/ -#ifndef __CA_GLOBALMUTEX_H__ -#define __CA_GLOBALMUTEX_H__ - -#include "ThreadManager.h" - - -#define CA_GLOBALMUTEX_LOCK CAutoMutex g_locker(CCAGlobalMutex::get()) - -class CCAGlobalMutex -{ -public: - typedef CSimpleMutex MutexType; - - static MutexType& get() - { - static MutexType m_mutex; - - return m_mutex; - } -}; - - -#endif // __CA_GLOBALMUTEX_H__ - diff --git a/service/soft-sensor-manager/SSMCore/src/SSMInterface/SSMCore.cpp b/service/soft-sensor-manager/SSMCore/src/SSMInterface/SSMCore.cpp index d4e82bc..cab19c9 100644 --- a/service/soft-sensor-manager/SSMCore/src/SSMInterface/SSMCore.cpp +++ b/service/soft-sensor-manager/SSMCore/src/SSMInterface/SSMCore.cpp @@ -20,7 +20,6 @@ #include "SSMInterface/SSMCore.h" #include "SSMInterface/SoftSensorManager.h" #include "Common/InternalInterface.h" -#include "Common/CAGlobalMutex.h" static ISoftSensorManager *g_pSoftSensorManager = NULL; @@ -28,8 +27,6 @@ SSMRESULT CreateQueryEngine(OUT IQueryEngine **ppQueryEngine) { SSMRESULT res = SSM_E_FAIL; - CA_GLOBALMUTEX_LOCK; - SSM_CLEANUP_NULL_ASSERT(g_pSoftSensorManager); SSM_CLEANUP_ASSERT(g_pSoftSensorManager->createQueryEngine(ppQueryEngine)); @@ -44,8 +41,6 @@ unsigned long ReleaseQueryEngine(IN IQueryEngine *pQueryEngine) return -1; } - CA_GLOBALMUTEX_LOCK; - if (g_pSoftSensorManager == NULL) { return -1; @@ -58,8 +53,6 @@ SSMRESULT InitializeSSMCore(IN std::string xmlDescription) { SSMRESULT res = SSM_E_FAIL; - CA_GLOBALMUTEX_LOCK; - SSM_CLEANUP_ASSERT(CreateGlobalInstanceRepo()); SSM_CLEANUP_ASSERT(CreateInstance(OID_ISoftSensorManager, (IBase**)&g_pSoftSensorManager)); SSM_CLEANUP_ASSERT(g_pSoftSensorManager->initializeCore(xmlDescription)); @@ -76,8 +69,6 @@ SSMRESULT StartSSMCore() { SSMRESULT res = SSM_E_FAIL; - CA_GLOBALMUTEX_LOCK; - SSM_CLEANUP_NULL_ASSERT(g_pSoftSensorManager); SSM_CLEANUP_ASSERT(g_pSoftSensorManager->startCore()); @@ -89,8 +80,6 @@ SSMRESULT StopSSMCore() { SSMRESULT res = SSM_E_FAIL; - CA_GLOBALMUTEX_LOCK; - SSM_CLEANUP_NULL_ASSERT(g_pSoftSensorManager); SSM_CLEANUP_ASSERT(g_pSoftSensorManager->stopCore()); @@ -102,8 +91,6 @@ SSMRESULT TerminateSSMCore(bool factoryResetFlag) { SSMRESULT res = SSM_E_FAIL; - CA_GLOBALMUTEX_LOCK; - SSM_CLEANUP_NULL_ASSERT(g_pSoftSensorManager); SSM_CLEANUP_ASSERT(g_pSoftSensorManager->terminateCore(factoryResetFlag)); @@ -155,8 +142,6 @@ SSMRESULT GetInstalledModelList(OUT std::vector *pList) { SSMRESULT res = SSM_E_FAIL; - CA_GLOBALMUTEX_LOCK; - SSM_CLEANUP_NULL_ASSERT(g_pSoftSensorManager); g_pSoftSensorManager->getInstalledModelList(pList);