diff options
author | Matt Cotter <matt.cotter@mongodb.com> | 2016-11-02 13:37:35 -0400 |
---|---|---|
committer | Matt Cotter <matt.cotter@mongodb.com> | 2016-11-07 11:14:19 -0500 |
commit | 52d16440aeb88962e579fc56e314c388f7c70ded (patch) | |
tree | 1a9db527f22bc0b11f557fc1f4636ef72e544344 | |
parent | ac465d21d85dfde7d55764cb714d8e235c22383f (diff) | |
download | mongo-52d16440aeb88962e579fc56e314c388f7c70ded.tar.gz |
SERVER-26864 switch NIA setAlarm to use durations
-rw-r--r-- | src/mongo/executor/network_interface_asio.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/executor/network_interface_asio.cpp b/src/mongo/executor/network_interface_asio.cpp index cf95829107d..74e677acb6d 100644 --- a/src/mongo/executor/network_interface_asio.cpp +++ b/src/mongo/executor/network_interface_asio.cpp @@ -466,8 +466,9 @@ Status NetworkInterfaceASIO::setAlarm(Date_t when, const stdx::function<void()>& std::shared_ptr<asio::system_timer> alarm; try { + auto timeLeft = when - now(); // "alarm" must stay alive until it expires, hence the shared_ptr. - alarm = std::make_shared<asio::system_timer>(_io_service, when.toSystemTimePoint()); + alarm = std::make_shared<asio::system_timer>(_io_service, timeLeft.toSystemDuration()); } catch (...) { return exceptionToStatus(); } |