src/Pure/System/scala.scala
changeset 72332 319dd5c618a5
parent 72294 25c6423ec538
child 72756 72ac27ea12b2
equal deleted inserted replaced
72331:850ba6d47300 72332:319dd5c618a5
   194     }
   194     }
   195 
   195 
   196     private def invoke_scala(msg: Prover.Protocol_Output): Boolean = synchronized
   196     private def invoke_scala(msg: Prover.Protocol_Output): Boolean = synchronized
   197     {
   197     {
   198       msg.properties match {
   198       msg.properties match {
   199         case Markup.Invoke_Scala(name, id) =>
   199         case Markup.Invoke_Scala(name, id, thread) =>
   200           futures += (id ->
   200           def body
   201             Future.fork {
   201           {
   202               val (tag, res) = Scala.function(name, msg.text)
   202             val (tag, res) = Scala.function(name, msg.text)
   203               result(id, tag, res)
   203             result(id, tag, res)
   204             })
   204           }
       
   205           val future =
       
   206             if (thread) {
       
   207               Future.thread(name = Isabelle_Thread.make_name(base = "invoke_scala"))(body)
       
   208             }
       
   209             else Future.fork(body)
       
   210           futures += (id -> future)
   205           true
   211           true
   206         case _ => false
   212         case _ => false
   207       }
   213       }
   208     }
   214     }
   209 
   215