more robust: active consumer for check_state/check_progress;
authorwenzelm
Sun, 16 Oct 2022 13:02:58 +0200
changeset 76311 fab6568b119d
parent 76310 c5c747ce46d2
child 76312 5f6c43eeff90
more robust: active consumer for check_state/check_progress;
src/Pure/PIDE/headless.scala
--- a/src/Pure/PIDE/headless.scala	Sat Oct 15 16:09:05 2022 +0200
+++ b/src/Pure/PIDE/headless.scala	Sun Oct 16 13:02:58 2022 +0200
@@ -289,7 +289,7 @@
         } resources.load_theories(session, id, load_theories, dep_files, unicode_symbols, progress)
       }
 
-      val check_progress = {
+      lazy val check_progress = {
         var check_count = 0
         Event_Timer.request(Time.now(), repeat = Some(check_delay)) {
           if (progress.stopped) use_theories_state.change(_.cancel_result)
@@ -363,7 +363,7 @@
 
       try {
         session.commands_changed += consumer
-        check_state()
+        check_progress
         use_theories_state.guarded_access(_.join_result)
         check_progress.cancel()
       }