diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-03-18 15:16:24 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-03-18 15:19:00 +0100 |
commit | 16939df43a089ac30fec0fcf30a2f648d007cb60 (patch) | |
tree | 98046b9b2f7671d27ac8e69702afa6b0e2a457ef /stm/asyncTaskQueue.ml | |
parent | b4b98349d03c31227d0d86a6e3acda8c3cd5212c (diff) | |
parent | 34c467a4e41e20a9bf1318d47fbc09da94c5ad97 (diff) |
Merge branch 'v8.5'
Diffstat (limited to 'stm/asyncTaskQueue.ml')
-rw-r--r-- | stm/asyncTaskQueue.ml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/stm/asyncTaskQueue.ml b/stm/asyncTaskQueue.ml index 1c6b542ab..c7faef333 100644 --- a/stm/asyncTaskQueue.ml +++ b/stm/asyncTaskQueue.ml @@ -182,6 +182,13 @@ module Make(T : Task) = struct let () = Unix.sleep 1 in kill_if () in + let kill_if () = + try kill_if () + with Sys.Break -> + let () = stop_waiting := true in + let () = TQueue.broadcast queue in + Worker.kill proc + in let _ = Thread.create kill_if () in try while true do |