author | wenzelm |
Tue, 16 Sep 2008 15:37:32 +0200 | |
changeset 28241 | de20fccf6509 |
child 28550 | 422e9bd169ac |
permissions | -rw-r--r-- |
wenzelm@28241 | 1 |
(* Title: Pure/Concurrent/simple_thread.ML |
wenzelm@28241 | 2 |
ID: $Id$ |
wenzelm@28241 | 3 |
Author: Makarius |
wenzelm@28241 | 4 |
|
wenzelm@28241 | 5 |
Simplified thread fork interface. |
wenzelm@28241 | 6 |
*) |
wenzelm@28241 | 7 |
|
wenzelm@28241 | 8 |
signature SIMPLE_THREAD = |
wenzelm@28241 | 9 |
sig |
wenzelm@28241 | 10 |
val fork: bool -> (unit -> unit) -> Thread.thread |
wenzelm@28241 | 11 |
end; |
wenzelm@28241 | 12 |
|
wenzelm@28241 | 13 |
structure SimpleThread: SIMPLE_THREAD = |
wenzelm@28241 | 14 |
struct |
wenzelm@28241 | 15 |
|
wenzelm@28241 | 16 |
fun fork interrupts body = |
wenzelm@28241 | 17 |
Thread.fork (fn () => exception_trace (fn () => body ()), |
wenzelm@28241 | 18 |
if interrupts then Multithreading.regular_interrupts else Multithreading.no_interrupts); |
wenzelm@28241 | 19 |
|
wenzelm@28241 | 20 |
end; |