[llvm-cov] Don't spawn a thread unless ThreadCount > 1
authorVedant Kumar <vsk@apple.com>
Wed, 19 Oct 2016 17:55:44 +0000 (17:55 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 19 Oct 2016 17:55:44 +0000 (17:55 +0000)
commit6fd94bf47c9d43ae159f775f483b91ad8b995ffb
tree21fdb24105da4fcf1510e16cb800c0a1a1257c0e
parent1f90f2d33f72ec9e34da496323c1ccff89b23c21
[llvm-cov] Don't spawn a thread unless ThreadCount > 1

Initializing a ThreadPool with ThreadCount = 1 spawns a thread even
though we don't need to. This is at least slower than it needs to be,
and at worst may somehow be exacerbating PR30735 (llvm-cov times out
on ARM bots).

As a follow-up, I'll try to add logic to llvm::ThreadPool to avoid
spawning a thread when ThreadCount = 1.

llvm-svn: 284621
llvm/tools/llvm-cov/CodeCoverage.cpp