From edee36d00147dfaa99acf52a7b4d7ebf329b013f Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 26 Jun 2014 15:37:46 +0200 Subject: check_for_interrupt: better (but slower) in threading mode Experimenting with PIDE I discovered that yield is not sufficient to have a rescheduling, hence the delay. --- tactics/rewrite.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tactics/rewrite.ml') diff --git a/tactics/rewrite.ml b/tactics/rewrite.ml index 171b1f75a8..2e9d30dfc4 100644 --- a/tactics/rewrite.ml +++ b/tactics/rewrite.ml @@ -1213,9 +1213,13 @@ module Strategies = let try_ str : strategy = choice str id + let check_interrupt str e l c t r ev = + Control.check_for_interrupt (); + str e l c t r ev + let fix (f : strategy -> strategy) : strategy = - let rec aux env = f (fun env -> aux env) env in aux - + let rec aux env = f (fun env -> check_interrupt aux env) env in aux + let any (s : strategy) : strategy = fix (fun any -> try_ (seq s any)) -- cgit v1.2.3