[Lldb-commits] [PATCH] D13727: Add task pool to LLDB
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 14 11:21:01 PDT 2015
clayborg requested changes to this revision.
clayborg added a comment.
I agree with labath's comments and see if we can move TaskPoolImpl into the .cpp file.
================
Comment at: include/lldb/Utility/TaskPool.h:39-66
@@ +38,30 @@
+
+ class TaskPoolImpl
+ {
+ public:
+ TaskPoolImpl(uint32_t num_threads);
+
+ ~TaskPoolImpl();
+
+ template<typename F, typename... Args>
+ std::future<typename std::result_of<F(Args...)>::type>
+ AddTask(F&& f, Args&&... args);
+
+ void
+ Stop();
+
+ private:
+ static void
+ Worker(TaskPoolImpl* pool);
+
+ std::queue<std::function<void()>> m_tasks;
+ std::mutex m_tasks_mutex;
+ std::condition_variable m_tasks_cv;
+ bool m_stop;
+ std::vector<std::thread> m_threads;
+ };
+
+ static TaskPoolImpl&
+ GetImplementation();
+};
+
----------------
Can TaskPoolImpl be moved to the .cpp file in the anonymous namespace?
http://reviews.llvm.org/D13727
More information about the lldb-commits
mailing list