cancel, shutdown: notify_all;
authorwenzelm
Thu, 11 Sep 2008 22:22:59 +0200
changeset 28208 3a8b3453129a
parent 28207 e2431cc4dc66
child 28209 02f3222a392d
cancel, shutdown: notify_all;
src/Pure/Concurrent/future.ML
--- a/src/Pure/Concurrent/future.ML	Thu Sep 11 22:22:20 2008 +0200
+++ b/src/Pure/Concurrent/future.ML	Thu Sep 11 22:22:59 2008 +0200
@@ -277,7 +277,8 @@
 
 (*cancel: present and future group members will be interrupted eventually*)
 fun cancel x =
- (scheduler_check (); SYNCHRONIZED "cancel" (fn () => change canceled (cons (group_of x))));
+ (scheduler_check ();
+  SYNCHRONIZED "cancel" (fn () => (change canceled (cons (group_of x)); notify_all ())));
 
 
 (*global join and shutdown*)
@@ -287,6 +288,7 @@
    (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")));