X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FCommons%2FThreadPool.cpp;h=fd5cd3a64a4b23b688da97a1b455a02278d151a5;hb=fde81536bf4177b0ca88091eddf7afbf23ffb4bf;hp=5ec65eb42c5d66cec896f25a978f41ed7b457aa1;hpb=9922aaf128e9e5ecee4f80fe7bd717bd903ec688;p=platform%2Fframework%2Fweb%2Fwrt-plugins-common.git diff --git a/src/Commons/ThreadPool.cpp b/src/Commons/ThreadPool.cpp old mode 100755 new mode 100644 index 5ec65eb..fd5cd3a --- a/src/Commons/ThreadPool.cpp +++ b/src/Commons/ThreadPool.cpp @@ -30,7 +30,6 @@ namespace WrtDeviceApis { namespace Commons { - ThreadPool &ThreadPool::getInstance() { static ThreadPool theInstance; @@ -38,7 +37,7 @@ ThreadPool &ThreadPool::getInstance() } DPL::Event::AbstractEventDispatcher *ThreadPool::getDispatcher( - DPL::Event::ThreadEventDispatcher &callingThreadDispatcher) + DPL::Event::ThreadEventDispatcher &callingThreadDispatcher) { DPL::Thread *currentThread = DPL::Thread::GetCurrentThread(); //if we are in main thread @@ -50,8 +49,7 @@ DPL::Event::AbstractEventDispatcher *ThreadPool::getDispatcher( } ThreadPool::ThreadPool() -{ -} +{} ThreadPool::~ThreadPool() { @@ -63,7 +61,7 @@ ThreadPool::~ThreadPool() } DPL::Thread* ThreadPool::getThreadHandleCreateIfNotExists( - ThreadEnum::Enumeration type) + ThreadEnum::Enumeration type) { DPL::Mutex::ScopedLock lock(&m_threadHandlersMutex); ThreadHandleMap::iterator element = m_threadHandlers.find(type); @@ -73,7 +71,7 @@ DPL::Thread* ThreadPool::getThreadHandleCreateIfNotExists( DPL::Thread* newThread = new DPL::Thread(); m_threadHandlers.insert( m_threadHandlers.begin(), - std::pair(type, newThread)); + std::pair(type, newThread)); newThread->Run(); return newThread; } @@ -88,7 +86,8 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type) } /* we could stay with * getThreadHandleCreateIfNotExists(type); - * but by switch we can attach actually one thread to more than one ThreadEnums + * but by switch we can attach actually one thread to more than one + * ThreadEnums */ switch (type) { case ThreadEnum::NULL_THREAD: @@ -155,13 +154,15 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type) thandle = getThreadHandleCreateIfNotExists(ThreadEnum::POWER_THREAD); break; case ThreadEnum::PLUGIN_TEMPLETE_THREAD: - thandle = getThreadHandleCreateIfNotExists(ThreadEnum::PLUGIN_TEMPLETE_THREAD); + thandle = getThreadHandleCreateIfNotExists( + ThreadEnum::PLUGIN_TEMPLETE_THREAD); break; case ThreadEnum::BLUETOOTH_THREAD: thandle = getThreadHandleCreateIfNotExists(ThreadEnum::BLUETOOTH_THREAD); break; case ThreadEnum::APPLICATION_THREAD: - thandle = getThreadHandleCreateIfNotExists(ThreadEnum::APPLICATION_THREAD); + thandle = getThreadHandleCreateIfNotExists( + ThreadEnum::APPLICATION_THREAD); break; case ThreadEnum::GYROSCOPE_THREAD: thandle = getThreadHandleCreateIfNotExists(ThreadEnum::GYROSCOPE_THREAD); @@ -170,19 +171,23 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type) thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CLOCK_THREAD); break; case ThreadEnum::SYSTEMINFO_THREAD: - thandle = getThreadHandleCreateIfNotExists(ThreadEnum::SYSTEMINFO_THREAD); + thandle = getThreadHandleCreateIfNotExists( + ThreadEnum::SYSTEMINFO_THREAD); break; case ThreadEnum::CALLHISTORY_THREAD: - thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CALLHISTORY_THREAD); + thandle = getThreadHandleCreateIfNotExists( + ThreadEnum::CALLHISTORY_THREAD); break; case ThreadEnum::ACCOUNT_THREAD: - thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CALLHISTORY_THREAD); + thandle = getThreadHandleCreateIfNotExists( + ThreadEnum::CALLHISTORY_THREAD); break; case ThreadEnum::NFC_THREAD: thandle = getThreadHandleCreateIfNotExists(ThreadEnum::NFC_THREAD); break; case ThreadEnum::MEDIACONTENT_THREAD: - thandle = getThreadHandleCreateIfNotExists(ThreadEnum::MEDIACONTENT_THREAD); + thandle = getThreadHandleCreateIfNotExists( + ThreadEnum::MEDIACONTENT_THREAD); break; case ThreadEnum::SE_THREAD: thandle = getThreadHandleCreateIfNotExists(ThreadEnum::SE_THREAD); @@ -203,6 +208,5 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type) } return thandle; } - } } // WrtDeviceApisCommon