summaryrefslogtreecommitdiff
path: root/gui/worker.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-19 12:18:14 -0400
committerbd <bdunahu@operationnull.com>2025-04-19 12:18:14 -0400
commit5ad39ec769fa09b9ac4dcc8f66232ef51384a3c6 (patch)
tree76291c5284711f5e371134439dce2c4c48432528 /gui/worker.h
parent24de6faf71c85e0281b32fb899fcbe4fe82380c4 (diff)
Safely delete old controller object when re-initializing
Diffstat (limited to 'gui/worker.h')
-rw-r--r--gui/worker.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/gui/worker.h b/gui/worker.h
index acfffcf..20a9838 100644
--- a/gui/worker.h
+++ b/gui/worker.h
@@ -12,6 +12,7 @@
#include <QDebug>
#include <QObject>
#include <QThread>
+#include <QMutex>
#include <deque>
class Worker : public QObject
@@ -28,7 +29,10 @@ class Worker : public QObject
EX *ex_stage;
MM *mm_stage;
WB *wb_stage;
- Controller *ct;
+
+ Controller *ct = nullptr;
+ QMutex ct_mutex;
+
/**
* The size each progressive cache level increases by.
*/
@@ -37,11 +41,9 @@ class Worker : public QObject
public:
explicit Worker(QObject *parent = nullptr);
~Worker();
+ QMutex& get_ct_mutex() { return ct_mutex; }
public slots:
- void refreshDram();
- void refreshCache();
- void refreshRegisters();
void runSteps(int steps);
void configure(
std::vector<unsigned int> ways,