ilya-biryukov added inline comments.
================ Comment at: clangd/Threading.h:124 }; -void setThreadPriority(std::thread &T, ThreadPriority Priority); +// Sets scheduling priority for the calling thread. +void setCurrentThreadPriority(ThreadPriority Priority); ---------------- The comment looks redundant now. Maybe remove it? ================ Comment at: clangd/index/Background.cpp:202 std::lock_guard<std::mutex> Lock(QueueMu); - Queue.push_back(std::move(T)); + if (Priority == ThreadPriority::Low) { + Queue.push_back(Bind( ---------------- Since we might be interested in scheduling higher-priority tasks first anyway (not in this patch, but still), maybe store a pair of `(Task, Priority)` in the queue and call `setCurrentThreadPriority` when actually running the task? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55315/new/ https://reviews.llvm.org/D55315 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits