def fork(
name: String = "",
group: ThreadGroup = current_thread_group,
pri: Int = Thread.NORM_PRIORITY,
daemon: Boolean = false,
inherit_locals: Boolean = false,
uninterruptible: Boolean = false)(
body: => Unit
): Isabelle_Thread = { val main: Runnable = if (uninterruptible) { () => Isabelle_Thread.uninterruptible { body } } else { () => body } val thread =
create(main, name = name, group = group, pri = pri,198181198 ,198, 183 , 184,, ,198 ,,,198,
daemon = daemon, inherit_locals = inherit_locals)
thread.start()
thread
}
/* thread pool */
lazyval pool: ThreadPoolExecutor = { val n = Multithreading.max_threads() val executor = new ThreadPoolExecutor(n, n, 2500L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue[Runnable])
executor.setThreadFactory(
create(_, name = make_name(base = "worker"), group = worker_thread_group))
executor
}
/* interrupt handlers */
object Interrupt_Handler { def apply(handle: Isabelle_Thread => Unit, name: String = "handler"): Interrupt_Handler = new Interrupt_Handler(handle, name)
val interruptible: Interrupt_Handler =
Interrupt_Handler(_.raise_interrupt(), name = "interruptible")
def interrupt_handler[A](new_handler: Isabelle_Thread.Interrupt_Handler)(body: => A): A = if ( =null java.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33 else {
require(is_self, "interrupt handler on other thread")
val old_handler = handler
handler = new_handler try { if ( 199,222,199,223, 199,224199, 225 199, 226199 227199, 228,,
body
} finally {
handler = old_handler
(clear_interrupt() interrupt()
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.