tuned;
authorwenzelm
Sun, 07 Sep 2008 17:46:39 +0200
changeset 28148 a472d844994e
parent 28147 b44a7b259909
child 28149 26bd1245a46b
tuned;
src/Pure/Concurrent/schedule.ML
--- a/src/Pure/Concurrent/schedule.ML	Sun Sep 07 17:46:38 2008 +0200
+++ b/src/Pure/Concurrent/schedule.ML	Sun Sep 07 17:46:39 2008 +0200
@@ -20,9 +20,9 @@
 
 fun schedule n next_task = uninterruptible (fn restore_attributes => fn tasks =>
   let
-    (*protected execution*)
+    (*synchronized execution*)
     val lock = Mutex.mutex ();
-    fun PROTECTED e =
+    fun SYNCHRONIZED e =
       let
         val _ = Mutex.lock lock;
         val res = Exn.capture e ();
@@ -66,20 +66,20 @@
 
     (*worker thread*)
     fun worker () =
-      (case PROTECTED dequeue of
+      (case SYNCHRONIZED dequeue of
         Task {body, cont, fail} =>
           (case Exn.capture (restore_attributes body) () of
             Exn.Result () =>
-              (PROTECTED (fn () => (change queue cont; wakeup_all ())); worker ())
+              (SYNCHRONIZED (fn () => (change queue cont; wakeup_all ())); worker ())
           | Exn.Exn exn =>
-              PROTECTED (fn () =>
+              SYNCHRONIZED (fn () =>
                 (change status (cons exn); change queue fail; stop (); wakeup_all ())))
-      | Terminate => PROTECTED (fn () => (stop (); wakeup_all ())));
+      | Terminate => SYNCHRONIZED (fn () => (stop (); wakeup_all ())));
 
     (*main control: fork and wait*)
     fun fork 0 = ()
       | fork k = (start worker; fork (k - 1));
-    val _ = PROTECTED (fn () =>
+    val _ = SYNCHRONIZED (fn () =>
      (fork (Int.max (n, 1));
       while not (null (! running)) do
       (trace_active ();