Simplified thread fork interface.
authorwenzelm
Tue, 16 Sep 2008 15:37:32 +0200
changeset 28241 de20fccf6509
parent 28240 444d1e8ae496
child 28242 f978c8e75118
Simplified thread fork interface.
src/Pure/Concurrent/simple_thread.ML
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/Concurrent/simple_thread.ML	Tue Sep 16 15:37:32 2008 +0200
@@ -0,0 +1,20 @@
+(*  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;