[PATCH] D15464: Add a C++11 ThreadPool implementation in LLVM

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 12 13:59:04 PST 2015


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

Thanks! Will change my gold-plugin patch to use the thread pool once this is in.


================
Comment at: lib/Support/ThreadPool.cpp:45
@@ +44,3 @@
+
+          // We first need to signal that we are active before poping the queue
+          // in order for wait() to properly detect that even if the queue is
----------------
Nit: typo "popping"

================
Comment at: lib/Support/ThreadPool.cpp:139
@@ +138,3 @@
+ThreadPool::~ThreadPool() {
+  EnableFlag = false;
+  wait();
----------------
Is this just for completeness? It doesn't look like this flag is used when ! LLVM_ENABLE_THREADS.

================
Comment at: unittests/Support/ThreadPool.cpp:32
@@ +31,3 @@
+  // test that async & barrier work together properly.
+
+  std::atomic_int checked_in{0};
----------------
Ok, that seems reasonable. We can reevaluate if the test behaves flakily.


http://reviews.llvm.org/D15464





More information about the llvm-commits mailing list