aboutsummaryrefslogtreecommitdiffstats
path: root/gui/ice40/worker.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-06-22 12:11:22 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-06-22 12:49:40 +0200
commit3cd12e3671e5ee108f039cb4350bf885164a8cf5 (patch)
tree14e34395eae07ebcd7bb864754484b17558ae2b7 /gui/ice40/worker.h
parent71176ac5384c696dde1d5601ea1beb5c46f281c6 (diff)
downloadnextpnr-3cd12e3671e5ee108f039cb4350bf885164a8cf5.tar.gz
nextpnr-3cd12e3671e5ee108f039cb4350bf885164a8cf5.tar.bz2
nextpnr-3cd12e3671e5ee108f039cb4350bf885164a8cf5.zip
Add ability to terminate running tasks
Diffstat (limited to 'gui/ice40/worker.h')
-rw-r--r--gui/ice40/worker.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h
index 12d740dd..a2d220bd 100644
--- a/gui/ice40/worker.h
+++ b/gui/ice40/worker.h
@@ -1,17 +1,20 @@
#ifndef WORKER_H
#define WORKER_H
+#include <QMutex>
#include <QThread>
#include "nextpnr.h"
// FIXME
USING_NEXTPNR_NAMESPACE
+class TaskManager;
+
class Worker : public QObject
{
Q_OBJECT
public:
- Worker(Context *ctx);
+ Worker(Context *ctx, TaskManager *parent);
public Q_SLOTS:
void parsejson(const std::string &filename);
Q_SIGNALS:
@@ -29,11 +32,19 @@ class TaskManager : public QObject
public:
TaskManager(Context *ctx);
~TaskManager();
+ bool shouldTerminate();
+ void clearTerminate();
public Q_SLOTS:
void info(const std::string &text);
+ void terminate_thread();
Q_SIGNALS:
+ void terminate();
void parsejson(const std::string &);
void log(const std::string &text);
+
+ private:
+ QMutex mutex;
+ bool toTerminate;
};
#endif // WORKER_H