From 44fbaf79a3d76ce3476618759385a585b8f3fa45 Mon Sep 17 00:00:00 2001 From: Matt Cotter Date: Mon, 28 Mar 2016 14:11:05 -0400 Subject: SERVER-23199 switch setAlarm to use system clock --- src/mongo/executor/network_interface_asio.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mongo/executor/network_interface_asio.cpp b/src/mongo/executor/network_interface_asio.cpp index 8138bf43798..cf5d82c98b3 100644 --- a/src/mongo/executor/network_interface_asio.cpp +++ b/src/mongo/executor/network_interface_asio.cpp @@ -32,6 +32,8 @@ #include "mongo/executor/network_interface_asio.h" +#include + #include #include "mongo/executor/async_stream_factory.h" @@ -406,12 +408,9 @@ void NetworkInterfaceASIO::cancelAllCommands() { } } -const auto kMaxTimerDuration = duration_cast(asio::steady_timer::duration::max()); - void NetworkInterfaceASIO::setAlarm(Date_t when, const stdx::function& action) { // "alarm" must stay alive until it expires, hence the shared_ptr. - auto alarm = std::make_shared(_io_service, - std::min(when - now(), kMaxTimerDuration)); + auto alarm = std::make_shared(_io_service, when.toSystemTimePoint()); alarm->async_wait([alarm, this, action](std::error_code ec) { if (!ec) { return action(); -- cgit v1.2.1