summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/threadedtests.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2018-03-08 14:46:45 -0500
committerBenety Goh <benety@mongodb.com>2018-03-08 14:46:45 -0500
commit621cec966b8145b4fedd4d635c71ed20e7bed4ae (patch)
tree8d2503a16a7df9bdd756ab1555832e29c69ffbea /src/mongo/dbtests/threadedtests.cpp
parent0d4d523af37b1acd9bb6707dc670985df82ed8b7 (diff)
downloadmongo-621cec966b8145b4fedd4d635c71ed20e7bed4ae.tar.gz
SERVER-33625 remove OldThreadPool
Diffstat (limited to 'src/mongo/dbtests/threadedtests.cpp')
-rw-r--r--src/mongo/dbtests/threadedtests.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/dbtests/threadedtests.cpp b/src/mongo/dbtests/threadedtests.cpp
index 0af7e1c3631..ec1405abd3b 100644
--- a/src/mongo/dbtests/threadedtests.cpp
+++ b/src/mongo/dbtests/threadedtests.cpp
@@ -43,7 +43,7 @@
#include "mongo/platform/bits.h"
#include "mongo/stdx/functional.h"
#include "mongo/stdx/thread.h"
-#include "mongo/util/concurrency/old_thread_pool.h"
+#include "mongo/util/concurrency/thread_pool.h"
#include "mongo/util/concurrency/ticketholder.h"
#include "mongo/util/log.h"
#include "mongo/util/timer.h"
@@ -126,12 +126,17 @@ class ThreadPoolTest {
public:
void run() {
- OldThreadPool tp(nThreads);
+ ThreadPool::Options options;
+ options.maxThreads = options.minThreads = nThreads;
+ ThreadPool tp(options);
+ tp.startup();
for (unsigned i = 0; i < iterations; i++) {
- tp.schedule([=] { increment(2); });
+ ASSERT_OK(tp.schedule([=] { increment(2); }));
}
+ tp.waitForIdle();
+ tp.shutdown();
tp.join();
ASSERT_EQUALS(counter.load(), iterations * 2);