mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +02:00
Thread fixes for WinCE
This commit is contained in:
@@ -61,29 +61,17 @@ void ThreadImpl::setOSPriorityImpl(int prio, int /* policy */)
|
||||
}
|
||||
|
||||
|
||||
void ThreadImpl::startImpl(Runnable& target)
|
||||
void ThreadImpl::startImpl(SharedPtr<Runnable> pTarget)
|
||||
{
|
||||
if (isRunningImpl())
|
||||
throw SystemException("thread already running");
|
||||
|
||||
_pRunnableTarget = ⌖
|
||||
_pRunnableTarget = pTarget;
|
||||
|
||||
createImpl(runnableEntry, this);
|
||||
}
|
||||
|
||||
|
||||
void ThreadImpl::startImpl(Callable target, void* pData)
|
||||
{
|
||||
if (isRunningImpl())
|
||||
throw SystemException("thread already running");
|
||||
|
||||
_callbackTarget.callback = target;
|
||||
_callbackTarget.pData = pData;
|
||||
|
||||
createImpl(callableEntry, this);
|
||||
}
|
||||
|
||||
|
||||
void ThreadImpl::createImpl(Entry ent, void* pData)
|
||||
{
|
||||
_thread = CreateThread(NULL, _stackSize, ent, pData, 0, &_threadId);
|
||||
@@ -180,28 +168,4 @@ DWORD WINAPI ThreadImpl::runnableEntry(LPVOID pThread)
|
||||
}
|
||||
|
||||
|
||||
DWORD WINAPI ThreadImpl::callableEntry(LPVOID pThread)
|
||||
{
|
||||
_currentThreadHolder.set(reinterpret_cast<ThreadImpl*>(pThread));
|
||||
try
|
||||
{
|
||||
ThreadImpl* pTI = reinterpret_cast<ThreadImpl*>(pThread);
|
||||
pTI->_callbackTarget.callback(pTI->_callbackTarget.pData);
|
||||
}
|
||||
catch (Exception& exc)
|
||||
{
|
||||
ErrorHandler::handle(exc);
|
||||
}
|
||||
catch (std::exception& exc)
|
||||
{
|
||||
ErrorHandler::handle(exc);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ErrorHandler::handle();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
Reference in New Issue
Block a user