diff options
Diffstat (limited to 'gui/ice40/worker.h')
-rw-r--r-- | gui/ice40/worker.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h index 12d740dd..49d1df4d 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,23 @@ class TaskManager : public QObject public: TaskManager(Context *ctx); ~TaskManager(); + bool shouldTerminate(); + void clearTerminate(); + bool isPaused(); public Q_SLOTS: void info(const std::string &text); + void terminate_thread(); + void pause_thread(); + void continue_thread(); Q_SIGNALS: + void terminate(); void parsejson(const std::string &); void log(const std::string &text); + + private: + QMutex mutex; + bool toTerminate; + bool toPause; }; #endif // WORKER_H |