src/Pure/Concurrent/simple_thread.ML
author wenzelm
Tue, 16 Sep 2008 15:37:32 +0200
changeset 28241 de20fccf6509
child 28550 422e9bd169ac
permissions -rw-r--r--
Simplified thread fork interface.

(*  Title:      Pure/Concurrent/simple_thread.ML
    ID:         $Id$
    Author:     Makarius

Simplified thread fork interface.
*)

signature SIMPLE_THREAD =
sig
  val fork: bool -> (unit -> unit) -> Thread.thread
end;

structure SimpleThread: SIMPLE_THREAD =
struct

fun fork interrupts body =
  Thread.fork (fn () => exception_trace (fn () => body ()),
    if interrupts then Multithreading.regular_interrupts else Multithreading.no_interrupts);

end;