SimpleThread.synchronized;
authorwenzelm
Mon, 13 Oct 2008 15:48:37 +0200
changeset 28575 ed869f019642
parent 28574 e73db43298a6
child 28576 dc4aae271c41
SimpleThread.synchronized;
src/Pure/Concurrent/future.ML
--- a/src/Pure/Concurrent/future.ML	Mon Oct 13 15:48:36 2008 +0200
+++ b/src/Pure/Concurrent/future.ML	Mon Oct 13 15:48:37 2008 +0200
@@ -97,17 +97,7 @@
   val cond = ConditionVar.conditionVar ();
 in
 
-fun SYNCHRONIZED name e = Exn.release (uninterruptible (fn restore_attributes => fn () =>
-  let
-    val _ =
-      if Mutex.trylock lock then ()
-      else
-       (Multithreading.tracing 3 (fn () => name ^ ": locking ...");
-        Mutex.lock lock;
-        Multithreading.tracing 3 (fn () => name ^ ": ... locked"));
-    val result = Exn.capture (restore_attributes e) ();
-    val _ = Mutex.unlock lock;
-  in result end) ());
+fun SYNCHRONIZED name = SimpleThread.synchronized name lock;
 
 fun wait name = (*requires SYNCHRONIZED*)
  (Multithreading.tracing 3 (fn () => name ^ ": wait ...");