This commit is contained in:
Simon Cruanes 2024-02-02 23:29:09 -05:00
parent 65fd89708e
commit e8cc87f1f5
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 5 additions and 2 deletions

View file

@ -444,7 +444,7 @@ let await (fut : 'a t) : 'a =
resume ~ls k (Ok ())
| Error (exn, bt) ->
(* fail continuation immediately *)
resume ~ls k (Error (exn, bt))));
k (Error (exn, bt))));
};
(* un-suspended: we should have a result! *)
get_or_fail_exn fut

View file

@ -130,7 +130,10 @@ let run_task_now_ (self : state) ~runner (w : worker_state) ~name ~ls task :
schedule_task_ self w ~name ~ls:[||] task'
in
let resume ~ls k r = schedule_task_ self (Some w) ~name ~ls (fun () -> k r) in
let resume ~ls k r =
let w = find_current_worker_ () in
schedule_task_ self w ~name ~ls (fun () -> k r)
in
(* run the task now, catching errors *)
(try