[SSM] Remove global mutex
authorjk13 <jihyeok13.kim@samsung.com>
Mon, 17 Nov 2014 11:09:02 +0000 (20:09 +0900)
committerjk13 <jihyeok13.kim@samsung.com>
Mon, 17 Nov 2014 11:09:02 +0000 (20:09 +0900)
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 <jihyeok13.kim@samsung.com>
service/soft-sensor-manager/SSMCore/src/Common/CAGlobalMutex.h [deleted file]
service/soft-sensor-manager/SSMCore/src/SSMInterface/SSMCore.cpp

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 (file)
index 09aef40..0000000
+++ /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<CCAGlobalMutex::MutexType> g_locker(CCAGlobalMutex::get())
-
-class CCAGlobalMutex
-{
-public:        
-       typedef CSimpleMutex MutexType;
-       
-       static MutexType& get()
-       {
-               static MutexType m_mutex;
-               
-               return m_mutex;
-       }
-};
-
-
-#endif // __CA_GLOBALMUTEX_H__
-
index d4e82bc..cab19c9 100644 (file)
@@ -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<ISSMResource*> *pList)
 {
        SSMRESULT res = SSM_E_FAIL;
 
-       CA_GLOBALMUTEX_LOCK;
-
        SSM_CLEANUP_NULL_ASSERT(g_pSoftSensorManager);
        g_pSoftSensorManager->getInstalledModelList(pList);