summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Cotter <matt.cotter@mongodb.com>2016-11-02 13:37:35 -0400
committerMatt Cotter <matt.cotter@mongodb.com>2016-11-07 11:14:19 -0500
commit52d16440aeb88962e579fc56e314c388f7c70ded (patch)
tree1a9db527f22bc0b11f557fc1f4636ef72e544344
parentac465d21d85dfde7d55764cb714d8e235c22383f (diff)
downloadmongo-52d16440aeb88962e579fc56e314c388f7c70ded.tar.gz
SERVER-26864 switch NIA setAlarm to use durations
-rw-r--r--src/mongo/executor/network_interface_asio.cpp3
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();
}