summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/tool/ClangdMain.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-11-27 12:09:13 +0000
committerSam McCall <sam.mccall@gmail.com>2018-11-27 12:09:13 +0000
commit032f3e7fd8a12ceab800b0d9c3aca0f769f7b7cc (patch)
tree1e6ed4fea4e9c0e48af593956d38c5cfe50b232b /clang-tools-extra/clangd/tool/ClangdMain.cpp
parent60b7103ce8f692d9b836902dacccdb096168251e (diff)
downloadbcm5719-llvm-032f3e7fd8a12ceab800b0d9c3aca0f769f7b7cc.tar.gz
bcm5719-llvm-032f3e7fd8a12ceab800b0d9c3aca0f769f7b7cc.zip
[clangd] Prevent thread starvation in tests on loaded systems.
Summary: Background index deliberately runs low-priority, but for tests this may stop them making progress. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D54938 llvm-svn: 347655
Diffstat (limited to 'clang-tools-extra/clangd/tool/ClangdMain.cpp')
-rw-r--r--clang-tools-extra/clangd/tool/ClangdMain.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index e349ee02751..ea542c1086b 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -254,6 +254,7 @@ int main(int argc, char *argv[]) {
RunSynchronously = true;
InputStyle = JSONStreamStyle::Delimited;
PrettyPrint = true;
+ preventThreadStarvationInTests(); // Ensure background index makes progress.
}
if (Test || EnableTestScheme) {
static URISchemeRegistry::Add<TestScheme> X(
OpenPOWER on IntegriCloud