* 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:
David Shawley
2007-11-18 18:26:24 +00:00
parent 6068e26cdd
commit fbb1c1fd44
5 changed files with 73 additions and 24 deletions

View File

@@ -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;
}
}