[Lldb-commits] [PATCH] D78337: [lldb/Host] Remove TaskPool and replace its uses with llvm::ThreadPool
Konrad Wilhelm Kleine via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 17 02:07:55 PDT 2020
kwk accepted this revision.
kwk added a comment.
This revision is now accepted and ready to land.
All tests pass. I first thought that the `lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test` test didn't work but it seems to be flaky.
================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp:90
// unit refers to another and the indexes accesses those DIEs.
- TaskMapOverInt(0, units_to_index.size(), extract_fn);
+ TaskMapOverInt(units_to_index.size(), extract_fn);
----------------
labath wrote:
> All of this should use the same ThreadPool instance to avoid re-creating the pool threads a couple of times.
@JDevlieghere I assume you've removed the first of the three parameters to `TaskMapOverInt` because it was always `0` anyways? If not, shouldn't this be easily changeable?
```lang=c++
static void TaskMapOverInt(size_t idx, size_t end,
const llvm::function_ref<void(size_t)> &func) {
llvm::ThreadPool pool;
for (; idx < end; idx++)
pool.async(func, idx);
pool.wait();
}
```
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78337/new/
https://reviews.llvm.org/D78337
More information about the lldb-commits
mailing list