src/Pure/ML-Systems/multithreading_dummy.ML
author wenzelm
Tue, 24 Jul 2007 22:53:48 +0200
changeset 23973 b6ce6de5b700
parent 23960 c07ae96cbfc4
child 23980 d35dc9344515
permissions -rw-r--r--
renamed number_of_threads to max_threads; added schedule operator;

(*  Title:      Pure/ML-Systems/multithreading_dummy.ML
    ID:         $Id$
    Author:     Makarius

Compatibility file for ML systems without multithreading.
*)

signature MULTITHREADING =
sig
  val max_threads: int ref
  val self_critical: unit -> bool
  val CRITICAL: (unit -> 'a) -> 'a
  val schedule: int -> ('a -> (unit -> unit) option * 'a) -> 'a -> exn list
end;

structure Multithreading: MULTITHREADING =
struct

val max_threads = ref 1;

fun self_critical () = false;
fun CRITICAL e = e ();

fun schedule _ _ _ = raise Fail ("No multithreading support for " ^ ml_system);

end;

val CRITICAL = Multithreading.CRITICAL;