[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

Andrew Ng via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 10:47:33 PDT 2025


================
@@ -119,7 +130,24 @@ class ThreadPoolExecutor : public Executor {
       auto Task = std::move(WorkStack.back());
       WorkStack.pop_back();
       Lock.unlock();
-      Task();
+
+      if (TheJobserver) {
+        JobSlot Slot = TheJobserver->tryAcquire();
----------------
nga888 wrote:

IIUC, I think this could cause deadlock. For example, if `make` has 4 job slots and has already started 4 instances of `lld`, then there will never be an available job slot on the assumption that each of the instances of `lld` need to run some task in the thread pool. I think that one of the thread pool threads needs to be unconditionally "always enabled". This might apply to `ThreadPool.cpp` too.

https://github.com/llvm/llvm-project/pull/145131


More information about the llvm-commits mailing list