Looper: implementation
This commit is contained in:
parent
be97473779
commit
af92ed505b
2 changed files with 9 additions and 4 deletions
|
|
@ -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 ;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue