src/Pure/Thy/thy_resources.scala
changeset 68758 a110e7e24e55
parent 68694 03e104be99af
child 68770 add44e2b8cb0
equal deleted inserted replaced
68757:e7e3776385ba 68758:a110e7e24e55
    56   }
    56   }
    57 
    57 
    58   class Theories_Result private[Thy_Resources](
    58   class Theories_Result private[Thy_Resources](
    59     val state: Document.State,
    59     val state: Document.State,
    60     val version: Document.Version,
    60     val version: Document.Version,
    61     val nodes: List[(Document.Node.Name, Protocol.Node_Status)])
    61     val nodes: List[(Document.Node.Name, Document_Status.Node_Status)])
    62   {
    62   {
    63     def node_names: List[Document.Node.Name] = nodes.map(_._1)
    63     def node_names: List[Document.Node.Name] = nodes.map(_._1)
    64     def ok: Boolean = nodes.forall({ case (_, st) => st.ok })
    64     def ok: Boolean = nodes.forall({ case (_, st) => st.ok })
    65 
    65 
    66     def snapshot(node_name: Document.Node.Name): Document.Snapshot =
    66     def snapshot(node_name: Document.Node.Name): Document.Snapshot =
   116         state.stable_tip_version match {
   116         state.stable_tip_version match {
   117           case Some(version) =>
   117           case Some(version) =>
   118             if (beyond_limit || dep_theories.forall(state.node_consolidated(version, _))) {
   118             if (beyond_limit || dep_theories.forall(state.node_consolidated(version, _))) {
   119               val nodes =
   119               val nodes =
   120                 for (name <- dep_theories)
   120                 for (name <- dep_theories)
   121                 yield (name -> Protocol.node_status(state, version, name))
   121                 yield (name -> Document_Status.Node_Status.make(state, version, name))
   122               try { result.fulfill(new Theories_Result(state, version, nodes)) }
   122               try { result.fulfill(new Theories_Result(state, version, nodes)) }
   123               catch { case _: IllegalStateException => }
   123               catch { case _: IllegalStateException => }
   124             }
   124             }
   125           case None =>
   125           case None =>
   126         }
   126         }
   155                 val initialized =
   155                 val initialized =
   156                   theories_progress.change_result(theories =>
   156                   theories_progress.change_result(theories =>
   157                   {
   157                   {
   158                     val initialized =
   158                     val initialized =
   159                       (check_theories -- theories).toList.filter(name =>
   159                       (check_theories -- theories).toList.filter(name =>
   160                         Protocol.node_status(snapshot.state, snapshot.version, name).initialized)
   160                         Document_Status.Node_Status.make(
       
   161                           snapshot.state, snapshot.version, name).initialized)
   161                     (initialized, theories ++ initialized)
   162                     (initialized, theories ++ initialized)
   162                   })
   163                   })
   163                 initialized.map(_.theory).sorted.foreach(progress.theory("", _))
   164                 initialized.map(_.theory).sorted.foreach(progress.theory("", _))
   164               }
   165               }
   165 
   166