fix: 修复工作线程标志位判断错误

fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/2460
This commit is contained in:
MistEO
2022-10-27 10:42:42 +08:00
parent 0703b68ca3
commit f446c8afdb

View File

@@ -266,7 +266,8 @@ void Assistant::working_proc()
: (ret ? AsstMsg::TaskChainCompleted : AsstMsg::TaskChainError);
task_callback(msg, callback_json, this);
if (!m_thread_idle) {
if (m_thread_idle) {
finished_tasks.clear();
continue;
}
@@ -276,7 +277,7 @@ void Assistant::working_proc()
finished_tasks.clear();
}
auto delay = Configer.get_options().task_delay;
const int delay = Configer.get_options().task_delay;
lock.lock();
m_condvar.wait_for(lock, std::chrono::milliseconds(delay), [&]() -> bool { return m_thread_idle; });
}