shutdown only if Multithreading.available;
authorwenzelm
Wed, 17 Sep 2008 22:06:52 +0200
changeset 28276 fbc707811203
parent 28275 8dab53900e8c
child 28277 f2995a28e0e4
shutdown only if Multithreading.available;
src/Pure/Concurrent/future.ML
--- a/src/Pure/Concurrent/future.ML	Wed Sep 17 21:27:44 2008 +0200
+++ b/src/Pure/Concurrent/future.ML	Wed Sep 17 22:06:52 2008 +0200
@@ -281,13 +281,15 @@
 
 (*global join and shutdown*)
 fun shutdown () =
- (scheduler_check ();
-  SYNCHRONIZED "shutdown" (fn () =>
-   (while not (scheduler_active ()) do wait "shutdown: scheduler inactive";
-    while not (TaskQueue.is_empty (! queue)) do wait "shutdown: join";
-    do_shutdown := true;
-    notify_all ();
-    while not (null (! workers)) do wait "shutdown: workers";
-    while scheduler_active () do wait "shutdown: scheduler still active")));
+  if Multithreading.available then
+   (scheduler_check ();
+    SYNCHRONIZED "shutdown" (fn () =>
+     (while not (scheduler_active ()) do wait "shutdown: scheduler inactive";
+      while not (TaskQueue.is_empty (! queue)) do wait "shutdown: join";
+      do_shutdown := true;
+      notify_all ();
+      while not (null (! workers)) do wait "shutdown: workers";
+      while scheduler_active () do wait "shutdown: scheduler still active")))
+  else ();
 
 end;