File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212#include " working_files.hh"
1313
1414#include < llvm/ADT/Twine.h>
15+ #include < llvm/Config/llvm-config.h>
1516#include < llvm/Support/Threading.h>
1617
1718#include < rapidjson/document.h>
@@ -255,6 +256,12 @@ void *indexer(void *arg_) {
255256 delete arg;
256257 std::string name = " indexer" + std::to_string (idx);
257258 set_thread_name (name.c_str ());
259+ // Don't lower priority on __APPLE__. getpriority(2) says "When setting a
260+ // thread into background state the scheduling priority is set to lowest
261+ // value, disk and network IO are throttled."
262+ #if LLVM_ENABLE_THREADS && LLVM_VERSION_MAJOR >= 9 && !defined(__APPLE__)
263+ set_thread_priority (ThreadPriority::Background);
264+ #endif
258265 pipeline::indexer_Main (h->manager , h->vfs , h->project , h->wfiles );
259266 pipeline::threadLeave ();
260267 return nullptr ;
You can’t perform that action at this time.
0 commit comments