mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user