[clangd] fix non linux build
authorDavid Carlier <devnexen@gmail.com>
Wed, 31 Oct 2018 09:04:15 +0000 (09:04 +0000)
committerDavid Carlier <devnexen@gmail.com>
Wed, 31 Oct 2018 09:04:15 +0000 (09:04 +0000)
There is no SCHED_IDLE semantic equivalent in BSD systems.

Reviewers: kadircet, sammccall

Revieweed By: sammccall

Differential Revision: https://reviews.llvm.org/D53922

llvm-svn: 345700

clang-tools-extra/clangd/Threading.cpp

index 9f1cbef..af9c179 100644 (file)
@@ -102,7 +102,7 @@ void wait(std::unique_lock<std::mutex> &Lock, std::condition_variable &CV,
 }
 
 void setThreadPriority(std::thread &T, ThreadPriority Priority) {
-#ifdef HAVE_PTHREAD_H
+#if defined(HAVE_PTHREAD_H) && defined(__linux__)
   sched_param priority;
   priority.sched_priority = 0;
   pthread_setschedparam(