[clangd] Make background index thread count calculation clearer
authorSam McCall <sam.mccall@gmail.com>
Tue, 23 Jun 2020 06:39:30 +0000 (08:39 +0200)
committerSam McCall <sam.mccall@gmail.com>
Wed, 24 Jun 2020 22:18:53 +0000 (00:18 +0200)
commit3c5745cb1f3c501e551a8fa63b8f1d564c35016d
treeec14ba872fd837f7b0706e5d4912fb03763025ca
parent546be0883784838be5d07a82f39ec4390f49e19e
[clangd] Make background index thread count calculation clearer

Summary:
This confusion was inadvertently introduced in a change to the
heavyweight_hardware_concurrency API: 8404aeb56a73ab24f9b295111de3b37a37f0b841

- don't indirect through the rebuilder policy when building the thread pool
- document that rebuilder thresholds are exposed for testing only
- don't use 0 as a sentinel value for "all threads", as we use it as a
  sentinel value for "synchronous" (though unsupported for BackgroundIndex)
- rather than pick some new sentinel value, just always use 4 threads for tests

Reviewers: kadircet, aganea

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82352
clang-tools-extra/clangd/index/Background.cpp
clang-tools-extra/clangd/index/Background.h
clang-tools-extra/clangd/index/BackgroundRebuild.h