[llvm] cab904c - [lit] Remove unnecessary indirection in progress_callback

Julian Lettner via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 15:20:41 PDT 2020


Author: Julian Lettner
Date: 2020-04-02T14:45:54-07:00
New Revision: cab904c6d31cc55021a45171371a6ab9486d18af

URL: https://github.com/llvm/llvm-project/commit/cab904c6d31cc55021a45171371a6ab9486d18af
DIFF: https://github.com/llvm/llvm-project/commit/cab904c6d31cc55021a45171371a6ab9486d18af.diff

LOG: [lit] Remove unnecessary indirection in progress_callback

On shutdown, the result complete handler is not racing with the main
thread anymore because we are now always waiting for process pool
termination via
```
  finally:
    pool.join()
```

Added: 
    

Modified: 
    llvm/utils/lit/lit/run.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py
index 4b91294ea8c2..2fa8ebfd9feb 100644
--- a/llvm/utils/lit/lit/run.py
+++ b/llvm/utils/lit/lit/run.py
@@ -85,7 +85,7 @@ def _execute(self, deadline):
 
         async_results = [
             pool.apply_async(lit.worker.execute, args=[test],
-                             callback=self._process_completed)
+                             callback=self.progress_callback)
             for test in self.tests]
         pool.close()
 
@@ -111,13 +111,6 @@ def _wait_for(self, async_results, deadline):
                     if self.failures == self.max_failures:
                         raise MaxFailuresError()
 
-    def _process_completed(self, test):
-        # Avoid racing with the main thread, which is going to terminate the
-        # process pool soon.
-        if self.failures == self.max_failures:
-            return
-        self.progress_callback(test)
-
     # TODO(yln): interferes with progress bar
     # Some tests use threads internally, and at least on Linux each of these
     # threads counts toward the current process limit. Try to raise the (soft)


        


More information about the llvm-commits mailing list