src/Pure/Concurrent/synchronized.ML
changeset 32286 1fb5db48002d
parent 32252 fd5e4a1a4ea6
child 32295 400cc493d466
--- a/src/Pure/Concurrent/synchronized.ML	Thu Jul 30 18:43:52 2009 +0200
+++ b/src/Pure/Concurrent/synchronized.ML	Thu Jul 30 23:06:06 2009 +0200
@@ -48,11 +48,9 @@
           (case f x of
             SOME (y, x') => (var := x'; SOME y)
           | NONE =>
-              (case time_limit x of
-                NONE => (ConditionVar.wait (cond, lock); try_change ())
-              | SOME t =>
-                  if ConditionVar.waitUntil (cond, lock, t) then try_change ()
-                  else NONE))
+              if Multithreading.sync_wait (time_limit x) cond lock
+              then try_change ()
+              else NONE)
         end;
       val res = try_change ();
       val _ = ConditionVar.broadcast cond;