--- 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;