mirror of
https://github.com/MaskRay/ccls.git
synced 2025-04-08 09:52:15 +00:00
Set indexer threads' priority to ThreadPriority::Background (#538)
This commit is contained in:
parent
e2284a3c62
commit
64e3e8f250
@ -12,6 +12,7 @@
|
|||||||
#include "working_files.hh"
|
#include "working_files.hh"
|
||||||
|
|
||||||
#include <llvm/ADT/Twine.h>
|
#include <llvm/ADT/Twine.h>
|
||||||
|
#include <llvm/Config/llvm-config.h>
|
||||||
#include <llvm/Support/Threading.h>
|
#include <llvm/Support/Threading.h>
|
||||||
|
|
||||||
#include <rapidjson/document.h>
|
#include <rapidjson/document.h>
|
||||||
@ -255,6 +256,9 @@ void *indexer(void *arg_) {
|
|||||||
delete arg;
|
delete arg;
|
||||||
std::string name = "indexer" + std::to_string(idx);
|
std::string name = "indexer" + std::to_string(idx);
|
||||||
set_thread_name(name.c_str());
|
set_thread_name(name.c_str());
|
||||||
|
#if LLVM_ENABLE_THREADS && LLVM_VERSION_MAJOR >= 9
|
||||||
|
set_thread_priority(ThreadPriority::Background);
|
||||||
|
#endif
|
||||||
pipeline::indexer_Main(h->manager, h->vfs, h->project, h->wfiles);
|
pipeline::indexer_Main(h->manager, h->vfs, h->project, h->wfiles);
|
||||||
pipeline::threadLeave();
|
pipeline::threadLeave();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user