mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 18:22:59 +02:00
* include/Poco/Tuple.h
- Named the inner enumerations to fix SF issue#1834127
* include/Poco/RunnableAdapter.h
- Added missing ``return *this'' to RunnableAdapter::operator=
* src/TaskManager.cpp
- Added try-catch block in TaskManager::start to ensure that _taskList
is properly maintained. Fix for SF issue#1829700
* testsuite/src/TaskManagerTest.cpp
* testsuite/src/TaskManagerTest.h
- Added test cases for SF issue@1829700
This commit is contained in:
@@ -64,12 +64,24 @@ TaskManager::~TaskManager()
|
||||
|
||||
void TaskManager::start(Task* pTask)
|
||||
{
|
||||
TaskPtr pAutoTask(pTask); // take ownership immediately
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
pTask->setOwner(this);
|
||||
pTask->setState(Task::TASK_STARTING);
|
||||
_taskList.push_back(TaskPtr(pTask));
|
||||
_threadPool.start(*pTask, pTask->name());
|
||||
pAutoTask->setOwner(this);
|
||||
pAutoTask->setState(Task::TASK_STARTING);
|
||||
_taskList.push_back(pAutoTask);
|
||||
try
|
||||
{
|
||||
_threadPool.start(*pAutoTask, pAutoTask->name());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Make sure that we don't act like we own the task since
|
||||
// we never started it. If we leave the task on our task
|
||||
// list, the size of the list is incorrect.
|
||||
_taskList.pop_back();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user