diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-06-24 11:56:12 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-06-24 12:03:13 -0400 |
commit | 728366e05a99058a2fb9530bf744fe7b4e5fda43 (patch) | |
tree | ff99e15173ae770665d3debbd53e139ae1331799 | |
parent | 51cd740ce156485f5b4fcfad159fe3cf22d89065 (diff) | |
download | mongo-728366e05a99058a2fb9530bf744fe7b4e5fda43.tar.gz |
SERVER-19000 Fix thread_pool_test.
While joining a ThreadPool, the value of the "numThreads" stats value is locked
at the number of threads that existed when the join operation began, even if one
or more of those threads have since exited. This is because the numThreads value
is computed as the number of threads in the _threads container, which are the
threads that will be joined individually during a pool join operation.
As such, it is not correct to make assertions about the value of numThreads
while ThreadPool::join is running, as it is in DestructionDuringDoubleJoins.
-rw-r--r-- | src/mongo/util/concurrency/thread_pool_test.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/mongo/util/concurrency/thread_pool_test.cpp b/src/mongo/util/concurrency/thread_pool_test.cpp index 74881f0508e..3f8f0ef07e8 100644 --- a/src/mongo/util/concurrency/thread_pool_test.cpp +++ b/src/mongo/util/concurrency/thread_pool_test.cpp @@ -274,7 +274,6 @@ DEATH_TEST(ThreadPoolTest, while ((stats = pool->getStats()).numIdleThreads != 0U) { sleepmillis(50); } - ASSERT_EQ(1U, stats.numThreads); ASSERT_EQ(0U, stats.numPendingTasks); pool.reset(); lk.unlock(); |