Migrate to a common timer class
This change pulls in sdeventplus and uses the timer implementation as
a drop in for the currently included timer.
Tested:
Unit tests still build but are not currently running. Manually
tested this change on a zaius machine and made sure timers went off.
Change-Id: I2808196581fc766843931403b83fead16926b0ae
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/rtnetlink_server.cpp b/rtnetlink_server.cpp
index 3121e4d..2e2436b 100644
--- a/rtnetlink_server.cpp
+++ b/rtnetlink_server.cpp
@@ -1,6 +1,5 @@
#include "rtnetlink_server.hpp"
-#include "timer.hpp"
#include "types.hpp"
#include "util.hpp"
@@ -22,7 +21,7 @@
namespace network
{
-extern std::unique_ptr<phosphor::network::Timer> refreshObjectTimer;
+extern std::unique_ptr<Timer> refreshObjectTimer;
namespace rtnetlink
{
@@ -47,13 +46,11 @@
{
// starting the timer here to make sure that we don't want
// create the child objects multiple times.
- if (refreshObjectTimer->isExpired())
+ if (refreshObjectTimer->hasExpired())
{
- using namespace std::chrono;
- auto time = duration_cast<microseconds>(refreshTimeout);
// if start timer throws exception then let the application
// crash
- refreshObjectTimer->startTimer(time);
+ refreshObjectTimer->restartOnce(refreshTimeout);
} // end if
} // end if