mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Make TaskManager independent of Future
`TaskManager` and `Future` where coupled together. When a task is pushed a future is returned. Also the `Future::Wrap` function was inconvenient to use. Now `TaskManager::PushTask` doesn't return a `Future` anymore. This alows to use different `Future`-like types. Also it's possible to easily use the `Future` with a different type that implements a `PushTask` function.
This commit is contained in:
@@ -185,7 +185,7 @@ size_t TaskManager::GetNumberOfWorkers() const
|
||||
return m->m_Workers.size();
|
||||
}
|
||||
|
||||
void TaskManager::DoPushTask(std::function<void()>&& task, TaskPriority priority)
|
||||
void TaskManager::PushTask(std::function<void()> task, TaskPriority priority)
|
||||
{
|
||||
m->PushTask(std::move(task), priority);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user