You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
#include "datamanagerthread.h"
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
|
|
DataManagerThread::DataManagerThread()
|
|
|
|
|
|
{
|
|
|
|
|
|
manager = nullptr;
|
|
|
|
|
|
isExit = false;
|
|
|
|
|
|
toManager = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DataManagerThread::run()
|
|
|
|
|
|
{
|
|
|
|
|
|
while(!isExit)
|
|
|
|
|
|
{
|
|
|
|
|
|
qDebug() << "run";
|
|
|
|
|
|
while(toManager)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(manager)
|
|
|
|
|
|
{
|
|
|
|
|
|
manager->doExcute();
|
|
|
|
|
|
emit managerFinished();
|
|
|
|
|
|
}
|
|
|
|
|
|
toManager = false;
|
|
|
|
|
|
manager = nullptr;
|
|
|
|
|
|
}
|
|
|
|
|
|
sleep(1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int DataManagerThread::startManager()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(!manager || isExit)
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
toManager = true;
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|