diff --git a/src/proc/control/looper.hpp b/src/proc/control/looper.hpp index ad6866770..ae80effc5 100644 --- a/src/proc/control/looper.hpp +++ b/src/proc/control/looper.hpp @@ -77,7 +77,8 @@ namespace control { */ class Looper { - + bool shutdown = false; + public: Looper() { } @@ -88,7 +89,7 @@ namespace control { bool isIdle() const { return false; } bool needBuild() const { return false; } bool isDisabled() const { return false; } - bool isDying() const { return false; } + bool isDying() const { return shutdown; } /** state fusion to control (timed) wait */ @@ -115,6 +116,11 @@ namespace control { } + void + triggerShutdown() + { + shutdown = true; + } /* == diagnostics == */ // size_t size() const ; diff --git a/tests/core/proc/control/dispatcher-looper-test.cpp b/tests/core/proc/control/dispatcher-looper-test.cpp index 408fcd600..91c5e2c5d 100644 --- a/tests/core/proc/control/dispatcher-looper-test.cpp +++ b/tests/core/proc/control/dispatcher-looper-test.cpp @@ -52,7 +52,6 @@ namespace test { */ struct Setup { - bool shutdown = false; Looper install() @@ -118,7 +117,7 @@ namespace test { CHECK (not looper.isDying()); CHECK (looper.shallLoop()); - setup.shutdown = true; + looper.triggerShutdown(); CHECK (looper.isDying()); CHECK (not looper.shallLoop()); }