================
@@ -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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to