Files
EJM_Display/Threads/SubThread.cpp

37 lines
608 B
C++
Raw Normal View History

2025-08-20 23:06:28 +08:00
#include "SubThread.h"
SubThread::SubThread()
{
isPause = false;
isLoop = true;
}
void SubThread::ReStart(){
isPause = false;
}
void SubThread::PauseThread()
{
isPause = true;
}
void SubThread::KillThread()
{
isLoop = false;
wait();
thread()->quit();
}
void SubThread::executeThreadLogic()
{
// 在这里实现线程的逻辑
while (isLoop)
{
QThread::msleep(CONFIG_EN_SUB_THREAD_TIME);//这个是子线程的基础时间,意在多长时间循环一次,单位毫秒
if(isPause) continue;
}
}
void SubThread::run()
{
executeThreadLogic();
}