diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
commit | f73363f1dd94996356cefbf24388f561891acf0b (patch) | |
tree | e3c31248bdb36eaec5fd833490d4278162dba2a0 /source/Host/common/TaskPool.cpp | |
parent | 160ee69dd7ae18978f4068116777639ea98dc951 (diff) |
Notes
Diffstat (limited to 'source/Host/common/TaskPool.cpp')
-rw-r--r-- | source/Host/common/TaskPool.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/Host/common/TaskPool.cpp b/source/Host/common/TaskPool.cpp index 156a079429985..c54b9a8ae56b1 100644 --- a/source/Host/common/TaskPool.cpp +++ b/source/Host/common/TaskPool.cpp @@ -49,8 +49,8 @@ void TaskPool::AddTaskImpl(std::function<void()> &&task_fn) { TaskPoolImpl::TaskPoolImpl() : m_thread_count(0) {} unsigned GetHardwareConcurrencyHint() { - // std::thread::hardware_concurrency may return 0 - // if the value is not well defined or not computable. + // std::thread::hardware_concurrency may return 0 if the value is not well + // defined or not computable. static const unsigned g_hardware_concurrency = std::max(1u, std::thread::hardware_concurrency()); return g_hardware_concurrency; @@ -64,9 +64,8 @@ void TaskPoolImpl::AddTask(std::function<void()> &&task_fn) { if (m_thread_count < GetHardwareConcurrencyHint()) { m_thread_count++; // Note that this detach call needs to happen with the m_tasks_mutex held. - // This prevents the thread - // from exiting prematurely and triggering a linux libc bug - // (https://sourceware.org/bugzilla/show_bug.cgi?id=19951). + // This prevents the thread from exiting prematurely and triggering a linux + // libc bug (https://sourceware.org/bugzilla/show_bug.cgi?id=19951). lldb_private::ThreadLauncher::LaunchThread("task-pool.worker", WorkerPtr, this, nullptr, min_stack_size) .Release(); |