mirror of
https://github.com/pocoproject/poco.git
synced 2026-01-26 21:44:49 +01:00
committed by
GitHub
parent
a9bc5e148f
commit
5e5e1a60f9
@@ -67,14 +67,20 @@ bool TaskManager::start(Task* pTask)
|
||||
pTask->setState(Task::TASK_STARTING);
|
||||
try
|
||||
{
|
||||
{
|
||||
ScopedLockT lock(_mutex);
|
||||
_taskList.push_back(pAutoTask);
|
||||
}
|
||||
_threadPool.start(*pTask, pTask->name());
|
||||
ScopedLockT lock(_mutex);
|
||||
_taskList.push_back(pAutoTask);
|
||||
return true;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
pTask->setOwner(nullptr);
|
||||
|
||||
ScopedLockT lock(_mutex);
|
||||
auto it = std::find(_taskList.begin(), _taskList.end(), pTask);
|
||||
if (it != _taskList.end()) _taskList.erase(it);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user