Remove timing window from RootStoppable (RIPD-1392):

RootStoppable was using two separate flags to identify that it
was stopping.  LoadManager was being notified when one flag was
set, but checking the other flag (not yet set) to see if we were
stopping.  There is no strong motivation for two flags.  The
timing window is closed by removing one flag and moving around
a chunk of code.
This commit is contained in:
Scott Schurr
2017-02-13 11:36:34 -08:00
parent c981eb81d9
commit b4e765362b
3 changed files with 36 additions and 23 deletions

View File

@@ -436,6 +436,13 @@ class Stoppable_test
Stoppable::stopped();
test_.expect(--test_.count == 0, "Root::onChildrenStopped called out of order");
}
void secondStop()
{
// Calling stop() a second time should have no negative
// consequences.
stop({});
}
};
public:
@@ -444,6 +451,7 @@ public:
{
Root rt(*this);
rt.run();
rt.secondStop();
}
pass();
}