[libclang] Add an environment variable to disable thread background priotity, for testing

llvm-svn: 166466
This commit is contained in:
Argyrios Kyrtzidis 2012-10-23 04:09:38 +00:00
parent 7cd5e831e5
commit 118fafa301
1 changed files with 3 additions and 0 deletions

View File

@ -6137,6 +6137,9 @@ void SetSafetyThreadStackSize(unsigned Value) {
}
void clang::setThreadBackgroundPriority() {
if (getenv("LIBCLANG_BGPRIO_DISABLE"))
return;
// FIXME: Move to llvm/Support and make it cross-platform.
#ifdef __APPLE__
setpriority(PRIO_DARWIN_THREAD, 0, PRIO_DARWIN_BG);