fix(modules): Warmup module on start

This commit is contained in:
Michael Carlberg 2017-01-12 20:29:08 +01:00
parent c2ac7fde67
commit 92cc4d6f40
2 changed files with 4 additions and 4 deletions

View File

@ -11,16 +11,15 @@ namespace modules {
using module<Impl>::module; using module<Impl>::module;
void start() { void start() {
CAST_MOD(Impl)->update();
CAST_MOD(Impl)->broadcast();
this->m_mainthread = thread(&event_module::runner, this); this->m_mainthread = thread(&event_module::runner, this);
} }
protected: protected:
void runner() { void runner() {
try { try {
// Warm up the module output before entering the loop
CAST_MOD(Impl)->update();
CAST_MOD(Impl)->broadcast();
while (this->running()) { while (this->running()) {
CAST_MOD(Impl)->idle(); CAST_MOD(Impl)->idle();

View File

@ -13,6 +13,7 @@ namespace modules {
using module<Impl>::module; using module<Impl>::module;
void start() { void start() {
CAST_MOD(Impl)->update();
this->m_mainthread = thread(&timer_module::runner, this); this->m_mainthread = thread(&timer_module::runner, this);
} }