X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjobs.ml;h=0a698ef153992ca61c9e2942b7ab9aa5a0c396fb;hb=8a0ede3292b4968b1e3261ad97b96d5ea0ad16fd;hp=f5aefa9aa9e321c93e42e2ad280a25af0c7cc5f1;hpb=defebbd4c75d43ad2d171cccbcc7ed737ff8a035;p=goals.git diff --git a/src/jobs.ml b/src/jobs.ml index f5aefa9..0a698ef 100644 --- a/src/jobs.ml +++ b/src/jobs.ml @@ -21,7 +21,7 @@ open Utils type 'a next = Job of 'a * (unit -> unit) | Complete | Not_ready -let run next_job retire_job string_of_job = +let run next_job retire_job fail_job string_of_job = (* Number of running threads <= Cmdline.nr_jobs. *) let running = ref 0 in @@ -38,7 +38,9 @@ let run next_job retire_job string_of_job = Mutex.lock lock; (match exn with | None -> retire_job job - | Some exn -> last_exn := exn :: !last_exn + | Some exn -> + last_exn := exn :: !last_exn; + fail_job job ); decr running; Condition.signal cond; @@ -46,7 +48,8 @@ let run next_job retire_job string_of_job = in let rec loop () = - if !last_exn = [] then ( + let continue = !last_exn = [] || Cmdline.keep_going () in + if continue then ( match next_job () with | Complete -> () | Not_ready ->