ThreadManager: Make TaskType a property of a Task.

This commit is contained in:
Unknown W. Brackets committed 2021-12-05 21:01:49 -08:00
1 parent f9bab64bdf
commit 8b5173350f
6 files changed
+30 -12

No files matched your search

+5 -1
View File
@@ -340,6 +340,10 @@ public:
info_->readyEvent.Notify();
}
TaskType Type() const override {
return TaskType::IO_BLOCKING;
}
void Run() override {
// An early-return will result in the destructor running, where we can set
// flags like working and pending.
@@ -738,7 +742,7 @@ std::shared_ptr<GameInfo> GameInfoCache::GetInfo(Draw::DrawContext *draw, const
}
GameInfoWorkItem *item = new GameInfoWorkItem(gamePath, info);
g_threadManager.EnqueueTask(item, TaskType::IO_BLOCKING);
g_threadManager.EnqueueTask(item);
// Don't re-insert if we already have it.
if (info_.find(pathStr) == info_.end())