summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/transport/baton_asio_linux.h2
-rw-r--r--src/mongo/util/interruptible.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/transport/baton_asio_linux.h b/src/mongo/transport/baton_asio_linux.h
index 591e550bfc4..3a796129977 100644
--- a/src/mongo/transport/baton_asio_linux.h
+++ b/src/mongo/transport/baton_asio_linux.h
@@ -331,7 +331,7 @@ public:
now = clkSource->now();
// Fire expired timers
- for (auto iter = _timers.begin(); iter != _timers.end() && iter->first < now;) {
+ for (auto iter = _timers.begin(); iter != _timers.end() && iter->first <= now;) {
toFulfill.push_back(std::move(iter->second.promise));
_timersById.erase(iter->second.id);
iter = _timers.erase(iter);
diff --git a/src/mongo/util/interruptible.h b/src/mongo/util/interruptible.h
index c93e96c88a1..76acfb36582 100644
--- a/src/mongo/util/interruptible.h
+++ b/src/mongo/util/interruptible.h
@@ -311,8 +311,9 @@ public:
stdx::unique_lock<stdx::mutex>& m,
Milliseconds ms,
Pred pred) {
+ const auto deadline = getExpirationDateForWaitForValue(ms);
while (!pred()) {
- if (stdx::cv_status::timeout == waitForConditionOrInterruptFor(cv, m, ms)) {
+ if (stdx::cv_status::timeout == waitForConditionOrInterruptUntil(cv, m, deadline)) {
return pred();
}
}