From f789d7d5a40bcd20d344a9a805afdaa1a82a7454 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Thu, 4 Jul 2019 13:23:19 -0700 Subject: [PATCH] Only call setpriority(PRIO_DARWIN_THREAD, 0, PRIO_DARWIN_BG) if it is available Tiger and earlier versions of darwin do not support this. Signed-off-by: Jeremy Huddleston Sequoia --- llvm/lib/Support/Unix/Threading.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc index 78ef46cd1a4c..51a39ec755ef 100644 --- a/llvm/lib/Support/Unix/Threading.inc +++ b/llvm/lib/Support/Unix/Threading.inc @@ -258,7 +258,7 @@ SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) { &priority) ? SetThreadPriorityResult::SUCCESS : SetThreadPriorityResult::FAILURE; -#elif defined(__APPLE__) +#elif defined(__APPLE__) && defined(PRIO_DARWIN_THREAD) && defined(PRIO_DARWIN_BG) // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpriority.2.html // When setting a thread into background state the scheduling priority is set // to lowest value, disk and network IO are throttled. Network IO will be -- 2.37.2