namespace WrtDeviceApis {
namespace Commons {
-
ThreadPool &ThreadPool::getInstance()
{
static ThreadPool theInstance;
}
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
}
ThreadPool::ThreadPool()
-{
-}
+{}
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);
DPL::Thread* newThread = new DPL::Thread();
m_threadHandlers.insert(
m_threadHandlers.begin(),
- std::pair<ThreadEnum::Enumeration,DPL::Thread*>(type, newThread));
+ std::pair<ThreadEnum::Enumeration, DPL::Thread*>(type, newThread));
newThread->Run();
return newThread;
}
}
/* 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:
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);
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);
}
return thandle;
}
-
}
} // WrtDeviceApisCommon