diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-24 14:39:39 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-24 14:39:39 +0200 |
| commit | ff4fbbdc5fa5ada01bd5bc3d8f8004279d7cc6b8 (patch) | |
| tree | 10ed90d03a7942a45513f04c87f12a122e847926 /src/modinfo.cpp | |
| parent | 73248d9e4036ad6b9494f678efbc97e919ebfbcf (diff) | |
Switch from ThreadPool to a simpler thread map for containers.
Diffstat (limited to 'src/modinfo.cpp')
| -rw-r--r-- | src/modinfo.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 81b45a49..eb0f0b4f 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -29,7 +29,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "modinfodialog.h" #include "overwriteinfodialog.h" #include "versioninfo.h" -#include "envfs.h" +#include "thread_utils.h" #include <iplugingame.h> #include <versioninfo.h> @@ -46,7 +46,6 @@ using namespace MOBase; using namespace MOShared; -env::ThreadPool<ModInfo::ModThread> ModInfo::s_Threads; std::vector<ModInfo::Ptr> ModInfo::s_Collection; std::map<QString, unsigned int> ModInfo::s_ModsByName; std::map<std::pair<QString, int>, std::vector<unsigned int>> ModInfo::s_ModsByModID; @@ -289,13 +288,7 @@ void ModInfo::updateFromDisc(const QString &modDirectory, std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName); - // This force loading a part of the FileTree: - s_Threads.setMax(refreshThreadCount); - for (auto& p : s_Collection) { - auto& t = s_Threads.request(); - t.ptr = p; - t.wakeup(); - } + parallelMap(std::begin(s_Collection), std::end(s_Collection), &ModInfo::isValid, refreshThreadCount); updateIndices(); |
