manage runner state properly (amending be4c1fbccfe8);
authorFabian Huch <huch@in.tum.de>
Tue, 27 Aug 2024 12:57:49 +0200
changeset 80779 a1b3abc629af
parent 80778 94bc8f62c835
child 80780 d6417e967a7c
manage runner state properly (amending be4c1fbccfe8);
src/Pure/Build/build_manager.scala
--- a/src/Pure/Build/build_manager.scala	Mon Aug 26 22:14:19 2024 +0100
+++ b/src/Pure/Build/build_manager.scala	Tue Aug 27 12:57:49 2024 +0200
@@ -802,10 +802,10 @@
           result_futures + (context.name -> result_future))
       }
 
-      def running: List[String] = process_futures.keys.toList
+      def running: List[String] = process_futures.keys.toList.filterNot(cancelling_until.contains)
 
       private def do_terminate(name: String): Boolean = {
-        val is_late = cancelling_until(name) > Time.now()
+        val is_late = Time.now() > cancelling_until(name)
         if (is_late) process_futures(name).join.terminate()
         is_late
       }
@@ -850,9 +850,7 @@
             if do_cancel(process_future)
           } yield name -> (Time.now() + cancel_timeout)
 
-        copy(
-          process_futures.filterNot((name, _) => cancelled.contains(name)),
-          cancelling_until = cancelling_until ++ cancelling_until1)
+        copy(cancelling_until = cancelling_until ++ cancelling_until1)
       }
     }
   }