Make Watchdog use single thread dispatch (#1347)

Notifier has one thread per instance because the callbacks must be
asynchronous. Watchdog callbacks can be synchronous, so this overhead
can be done away with via a scheduler thread akin to what the HAL
Notifier does.
This commit is contained in:
Tyler Veness
2018-12-01 00:05:33 -08:00
committed by Peter Johnson
parent 99033481e0
commit 3b33abfc7b
7 changed files with 730 additions and 67 deletions

View File

@@ -23,7 +23,7 @@ using namespace frc;
IterativeRobotBase::IterativeRobotBase(double period)
: m_period(period),
m_watchdog(period, [&] { PrintLoopOverrunMessage(); }) {}
m_watchdog(period, [this] { PrintLoopOverrunMessage(); }) {}
void IterativeRobotBase::RobotInit() {
wpi::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";