src/Pure/Concurrent/lazy.ML
changeset 68590 f3c3c1e6133a
parent 68130 6fb85346cb79
child 68597 afa7c5a239e6
equal deleted inserted replaced
68589:9258f16d68b4 68590:f3c3c1e6133a
    98                     val _ = Exn.capture (fn () => Future.fulfill_result x res0) ();
    98                     val _ = Exn.capture (fn () => Future.fulfill_result x res0) ();
    99                     val res = Future.join_result x;
    99                     val res = Future.join_result x;
   100                     (*semantic race: some other threads might see the same
   100                     (*semantic race: some other threads might see the same
   101                       interrupt, until there is a fresh start*)
   101                       interrupt, until there is a fresh start*)
   102                     val _ =
   102                     val _ =
   103                       if Exn.is_interrupt_exn res then
   103                       if Exn.is_interrupt_exn res
   104                         Synchronized.change var (fn _ => Expr (name, e))
   104                       then Synchronized.change var (fn _ => Expr (name, e))
   105                       else ();
   105                       else Synchronized.change var (fn _ => Result (Future.value_result res));
   106                   in res end
   106                   in res end
   107               | NONE => Exn.capture (restore_attributes (fn () => Future.join x)) ())
   107               | NONE => Exn.capture (restore_attributes (fn () => Future.join x)) ())
   108             end) ());
   108             end) ());
   109 
   109 
   110 end;
   110 end;