Fix last commit.

This commit is contained in:
Nodir Temirkhodjaev 2019-08-25 20:26:05 +05:00
parent 648a1e07cd
commit 33b642655b
2 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ ControlWorker::ControlWorker(QSystemSemaphore *semaphore,
QObject *parent) :
QObject(parent),
m_aborted(false),
m_finished(false),
m_semaphore(semaphore),
m_sharedMemory(sharedMemory)
{
@ -21,6 +22,8 @@ void ControlWorker::run()
while (!m_aborted && m_semaphore->acquire()) {
processRequest();
}
m_finished = true;
}
void ControlWorker::abort()
@ -30,6 +33,9 @@ void ControlWorker::abort()
m_semaphore->release();
m_mutex.lock();
if (!m_finished) {
m_mutex.unlock();
}
}
bool ControlWorker::post(const QString &scriptPath,

View File

@ -42,6 +42,7 @@ private:
private:
volatile bool m_aborted;
volatile bool m_finished;
QSystemSemaphore *m_semaphore;
QSharedMemory *m_sharedMemory;