[PATCH] D53651: [clangd] Use thread pool for background indexing.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 30 02:46:06 PDT 2018


ilya-biryukov added inline comments.


================
Comment at: clangd/Threading.cpp:101
 
+void setThreadPriority(std::thread &T, ThreadPriority Priority) {
+#ifdef HAVE_PTHREAD_H
----------------
Maybe put this helper into `llvm/Support/Threading.h`?


================
Comment at: clangd/Threading.h:120
+
+enum ThreadPriority {
+  LOW = 0,
----------------
sammccall wrote:
> nit: enum class since this is at clangd scope
Maybe use `enum class`?


================
Comment at: clangd/index/Background.h:19
 #include "llvm/Support/SHA1.h"
+#include "TUScheduler.h"
 #include <condition_variable>
----------------
sammccall wrote:
> depending on TUScheduler doesn't make sense here. Move the function to Threading.h instead?
Maybe move the `getDefaultAsyncThreadsCount` into `Threading.h`?
Having a dependency on TUScheduler in Background indexing is a bit misleading, since we're not actually sharing any threading infrastructure there.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53651





More information about the cfe-commits mailing list