actually observe Multithreading.enabled (cf. d302f1c9e356);
authorwenzelm
Sun, 20 Sep 2009 17:23:23 +0200
changeset 32614 fef7022dc5ab
parent 32613 0bc4f7e3e2d3
child 32615 20f1edc87b7d
actually observe Multithreading.enabled (cf. d302f1c9e356);
src/Pure/Concurrent/par_list.ML
--- a/src/Pure/Concurrent/par_list.ML	Sat Sep 19 10:19:34 2009 +0200
+++ b/src/Pure/Concurrent/par_list.ML	Sun Sep 20 17:23:23 2009 +0200
@@ -27,8 +27,10 @@
 struct
 
 fun raw_map f xs =
-  let val group = Task_Queue.new_group (Future.worker_group ())
-  in Future.join_results (map (fn x => Future.fork_group group (fn () => f x)) xs) end;
+  if Multithreading.enabled () then
+    let val group = Task_Queue.new_group (Future.worker_group ())
+    in Future.join_results (map (fn x => Future.fork_group group (fn () => f x)) xs) end
+  else map (Exn.capture f) xs;
 
 fun map f xs = Exn.release_first (raw_map f xs);