sys: Added filter option to find view

This commit is contained in:
WerWolv
2022-07-29 18:49:43 +02:00
parent ce193a0098
commit 419a2875b3
11 changed files with 62 additions and 21 deletions

View File

@@ -2,6 +2,8 @@
#include <hex/api/localization.hpp>
#include <algorithm>
namespace hex {
std::list<Task *> Task::s_runningTasks;
@@ -17,6 +19,19 @@ namespace hex {
this->finish();
}
Task::Task(hex::Task &&other) noexcept {
std::scoped_lock lock(Task::s_taskMutex);
this->m_name = other.m_name;
this->m_maxValue = other.m_maxValue;
this->m_currValue = other.m_currValue;
auto it = std::find(Task::s_runningTasks.begin(), Task::s_runningTasks.end(), &other);
if (it != Task::s_runningTasks.end()) {
*it = this;
}
}
void Task::finish() {
std::scoped_lock lock(Task::s_taskMutex);