Let the Taskmaster control whether the build stops.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 2 Oct 2001 12:24:41 +0000 (12:24 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 2 Oct 2001 12:24:41 +0000 (12:24 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@80 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Job.py
src/engine/SCons/JobTests.py

index 26031ff1cd0b4215de6d90c01407d8755c686e74..f17c07529c1cdfc0e797ebd7b7707ecd6bca0696 100644 (file)
@@ -86,8 +86,9 @@ class Serial:
             try:
                 task.execute()
             except:
+                # Let the failed() callback function arrange for the
+                # build to stop if that's appropriate.
                 self.taskmaster.failed(task)
-                return
             else:
                 self.taskmaster.executed(task)
 
@@ -219,12 +220,10 @@ class Parallel:
                     finally:
                         cv.acquire()
                 except:
+                    # Let the failed() callback function arrange for
+                    # calling self.jobs.stop() to to stop the build
+                    # if that's appropriate.
                     self.taskmaster.failed(task)
-                    # stop all jobs since there was a failure:
-                    # (this will wake up any waiting jobs, so
-                    #  it isn't necessary to explicitly wake them
-                    #  here)
-                    self.jobs.stop() 
                 else:
                     self.taskmaster.executed(task)
                     
index f2189eba5d51317f4479bc6a885b3b6a43928e19..b90ba1c62a49a12dacab9eeddb4bc497de7335d0 100644 (file)
@@ -68,6 +68,7 @@ class Taskmaster:
         """n is the number of dummy tasks to perform."""
 
         self.test_case = test_case
+        self.stop = None
         self.num_tasks = n
         self.num_iterated = 0
         self.num_executed = 0
@@ -88,7 +89,7 @@ class Taskmaster:
 
 
     def next_task(self):
-        if self.all_tasks_are_iterated():
+        if self.stop or self.all_tasks_are_iterated():
             return None
         else:
             self.num_iterated = self.num_iterated + 1
@@ -110,6 +111,7 @@ class Taskmaster:
 
     def failed(self, task):
         self.num_failed = self.num_failed + 1
+        self.stop = 1
     
     def is_blocked(self):
         # simulate blocking tasks