Skip to content

Commit

Permalink
Move ProcessorHandler futurewatcher connects to ProcessorHandler cons…
Browse files Browse the repository at this point in the history
…tructor

This fixes an issue where all of the connected stuff was being re-connected on every run, essentially creating a linear increase in execution time post-run.
  • Loading branch information
mortbopet committed Sep 5, 2021
1 parent ff9fbd5 commit d692d71
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/processorhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ ProcessorHandler::ProcessorHandler() {
m_enqueueStateChangeLock.unlock();
});

// Connect the runwatcher finished signals
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] {
emit runFinished();
_triggerProcStateChangeTimer();
});
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] { ProcessorStatusManager::clearStatus(); });

// Connect relevant settings changes to VSRTL
connect(RipesSettings::getObserver(RIPES_SETTING_REWINDSTACKSIZE), &SettingObserver::modified,
[=](const auto& size) { m_currentProcessor->setMaxReverseCycles(size.toUInt()); });
Expand Down Expand Up @@ -151,12 +158,6 @@ void ProcessorHandler::_run() {
emit runStarted();

// Start running through the VSRTL Widget interface
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] {
emit runFinished();
_triggerProcStateChangeTimer();
});
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, [=] { ProcessorStatusManager::clearStatus(); });

m_runWatcher.setFuture(QtConcurrent::run([=] {
auto* vsrtl_proc = dynamic_cast<vsrtl::SimDesign*>(m_currentProcessor.get());

Expand Down

0 comments on commit d692d71

Please sign in to comment.