summaryrefslogtreecommitdiff
path: root/src/mongo/executor/thread_pool_task_executor.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2020-05-13 14:09:30 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-14 15:28:44 +0000
commit06cfa3bd798b0328ae4b8e8fd18b11f7e8c554cf (patch)
treed194fb8c4cc01b5ba19b1cf18003c08ad0862d53 /src/mongo/executor/thread_pool_task_executor.cpp
parent40c0fa9c0a3cf5d3d2ee16fe301c262946ececa8 (diff)
downloadmongo-06cfa3bd798b0328ae4b8e8fd18b11f7e8c554cf.tar.gz
SERVER-48149 Compare exhaust iters before erasing
Diffstat (limited to 'src/mongo/executor/thread_pool_task_executor.cpp')
-rw-r--r--src/mongo/executor/thread_pool_task_executor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/executor/thread_pool_task_executor.cpp b/src/mongo/executor/thread_pool_task_executor.cpp
index 765c4f459a7..92ea98ab094 100644
--- a/src/mongo/executor/thread_pool_task_executor.cpp
+++ b/src/mongo/executor/thread_pool_task_executor.cpp
@@ -835,10 +835,10 @@ void ThreadPoolTaskExecutor::runCallbackExhaust(std::shared_ptr<CallbackState> c
// 'expectedExhaustIter' so that we can still remove this task from the 'poolInProgressQueue' if
// this happens, but we do not want to reset the 'exhaustIter' value in this case.
if (cbState->exhaustIter) {
- _poolInProgressQueue.erase(expectedExhaustIter);
if (cbState->exhaustIter.get() == expectedExhaustIter) {
cbState->exhaustIter = boost::none;
}
+ _poolInProgressQueue.erase(expectedExhaustIter);
}
if (_inShutdown_inlock() && _poolInProgressQueue.empty()) {